我们有一台像FotoCopy Machine一样的大型打印机。打印时,它可以分组/移动纸张。 例如:纸1至10 - >左移,11至25 - >右移,26至30 - >左转,等等。
我想我必须做一个Threading.Thread.Sleep(5000)
。
但我不知道如何在我的代码中实现:
LeOrdre_BL oOrdr_BL = new LeOrdre_BL();
protected void Page_Load(object sender, EventArgs e)
{
var xtraReport_Pricipal = new LetrVoiture();
if (oOrdr_BL.Get_All_LetrVoit_BL().Count != 0)
{
foreach (var oItem in oOrdr_BL.Get_All_LetrVoit_BL())
{
var xtraReport_Other = new LetrVoiture();
//Performing pre-rendering operations: binding, passing parameters and etc.
Session["IdVoit"] = oItem.LettreVoidID;
Session["Mode"] = oItem.ModlMod;
Session["PortDu"] = oItem.LibPort;
Session["Enlev"] = oItem.LibExpr;
Session["Unite"] = oItem.EnlvUnite;
Session["Colis"] = oItem.NbrColis;
Session["Poids"] = oItem.LePoids;
Session["LeCR"] = oItem.EnlvCrmb;
Session["LeVD"] = oItem.EnlvDecl;
Session["Code_Exp"] = oItem.ClientID;
Session["RS_Nom_Exp"] = oItem.RsNomExp;
Session["Addr_Exp"] = oItem.AddrExp;
Session["Cp_Exp"] = oItem.CpExp;
Session["Ville_Exp"] = oItem.VilleExp;
Session["Tel_Exp"] = oItem.TelExp;
Session["Fax_Exp"] = oItem.FaxExp;
Session["Code_Dest"] = oItem.CodeDest;
Session["RS_Nom_Dest"] = oItem.RaisonSoc;
Session["Addr_Dest"] = oItem.Adresse;
Session["Cp_Dest"] = oItem.Cp;
Session["Ville_Dest"] = oItem.Ville;
Session["Tel_Dest"] = oItem.Tel;
Session["Fax_Dest"] = oItem.Fax;
xtraReport_Other.CreateDocument();
xtraReport_Pricipal.Pages.AddRange(xtraReport_Other.Pages);
}
xtraReport_Pricipal.PrintingSystem.ContinuousPageNumbering = true;
using (MemoryStream ms = new MemoryStream())
{
try
{
PdfExportOptions opts = new PdfExportOptions();
opts.ShowPrintDialogOnOpen = true;
xtraReport_Pricipal.ExportToPdf(ms, opts);
ms.Seek(0, SeekOrigin.Begin);
byte[] report = ms.ToArray();
Page.Response.ContentType = "application/pdf";
Page.Response.Clear();
Page.Response.OutputStream.Write(report, 0, report.Length);
//Page.Response.End();
HttpContext.Current.ApplicationInstance.CompleteRequest();
}
finally
{
ms.Close();
}
}
}
//Response.AppendHeader("REFRESH", "4;URL=Ordre.aspx");
}
提前谢谢你, 甜菊