我打印的是小票。
每次打印到一多半(快结束)的时候,打印机就停一下(半秒左右),然后再继续打印剩下的部分。
有时候会出现连续两次打印小票相同的情况,虽然不多见,但是很想把这个bug解决掉(程序只调用了一次)。我感觉是和页面大小和边距设置有关。但是怎么调大小也还是老样子。
下面是我的代码
RptReceipt rpt = new RptReceipt(dtCurrent); //dtCurrent是DataTable
rpt.ReportUnit = DevExpress.XtraReports.UI.ReportUnit.TenthsOfAMillimeter;
rpt.PaperKind = System.Drawing.Printing.PaperKind.Custom;
rpt.PrintingSystem.ShowMarginsWarning = false;
try
{
rpt.PageHeight = 1300;
rpt.PageWidth = 880;
rpt.Margins.Left = 10;
rpt.Margins.Right = 10;
rpt.Margins.Top = 10;
rpt.Margins.Bottom = 10;
}
catch
{
PrintDocument pd = new PrintDocument();
rpt.PageHeight = pd.DefaultPageSettings.PaperSize.Height;
rpt.PageWidth = pd.DefaultPageSettings.PaperSize.Width;
}
rpt.Print();
每次打印到一多半(快结束)的时候,打印机就停一下(半秒左右),然后再继续打印剩下的部分。
有时候会出现连续两次打印小票相同的情况,虽然不多见,但是很想把这个bug解决掉(程序只调用了一次)。我感觉是和页面大小和边距设置有关。但是怎么调大小也还是老样子。
下面是我的代码
RptReceipt rpt = new RptReceipt(dtCurrent); //dtCurrent是DataTable
rpt.ReportUnit = DevExpress.XtraReports.UI.ReportUnit.TenthsOfAMillimeter;
rpt.PaperKind = System.Drawing.Printing.PaperKind.Custom;
rpt.PrintingSystem.ShowMarginsWarning = false;
try
{
rpt.PageHeight = 1300;
rpt.PageWidth = 880;
rpt.Margins.Left = 10;
rpt.Margins.Right = 10;
rpt.Margins.Top = 10;
rpt.Margins.Bottom = 10;
}
catch
{
PrintDocument pd = new PrintDocument();
rpt.PageHeight = pd.DefaultPageSettings.PaperSize.Height;
rpt.PageWidth = pd.DefaultPageSettings.PaperSize.Width;
}
rpt.Print();
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货