none
vs2005 调用水晶报表rpt文件格式变化问题 RRS feed

  • 问题

  • 
    
    

                    PrinterSettings printerSettings = new PrinterSettings();
                    PageSettings pageSettings = new PageSettings(printerSettings);
                    pageSettings.Margins.Bottom = 0;
                    pageSettings.Margins.Left = 0;
                    pageSettings.Margins.Right = 0;
                    pageSettings.Margins.Top = 0;
                    string rptFileName = string.Format(@"{0}\rpt\{1}", Application.StartupPath, m_LabelFormat.RptFileName);
                    printerSettings.PrintFileName = rptFileName;
                    CrystalDecisions.CrystalReports.Engine.ReportDocument reportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
                    reportDocument.Load(rptFileName);
                    reportDocument.PrintOptions.PrinterName = m_PrinterName;
                    reportDocument.SetDataSource(labPrtDT as DataTable);
                    reportDocument.PrintOptions.CustomPaperSource = pageSettings.PaperSource;
                    reportDocument.PrintToPrinter(1, true, 0, labPrtDT.Rows.Count);
    上面的c#语句,调用单独的rpt文件打印,但是发现更新c#的程序后会有打印错位的情况(rpt设计打印10多Item,有个别Item左右或上下偏离),检查rpt也没有任何修改,不知道问题出在何处?哪位牛人有类似的问题处理经验?

    lpc76

    2013年7月31日 1:21