日期:2014-05-18  浏览次数:21060 次

xtraReport打印的问题
我打印的是小票。
每次打印到一多半(快结束)的时候,打印机就停一下(半秒左右),然后再继续打印剩下的部分。
有时候会出现连续两次打印小票相同的情况,虽然不多见,但是很想把这个bug解决掉(程序只调用了一次)。

我感觉是和页面大小和边距设置有关。但是怎么调大小也还是老样子。
下面是我的代码

C# code

                    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();



------解决方案--------------------
接分