ar区域报表如何加载打印机自定义的纸张,在预览和打印指定预先设置好的纸张? 用哪个系统自带的ActiveReports 9 Designer打印预览纸张是好的,写程序调用代码打印就会选取打印机的USER 默义纸张
代码如下:
SectionReport report1;
report1 = new SectionReport();
report1.LoadLayout(Application.StartupPath + @"\Reports\" + CurrentReport);
report1.Document.Printer.PrinterName = "";
report1.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.Custom;
////设置打印纸张
System.Drawing.Printing.PrintDocument printDoc = new System.Drawing.Printing.PrintDocument();
foreach (PaperSize ps in printDoc.PrinterSettings.PaperSizes)
{
if (ps.PaperName == _PaperName)
{
//printDoc.PrinterSettings.DefaultPageSettings.PaperSize = ps;
//printDoc.DefaultPageSettings.PaperSize = ps;
report1.Document.Printer.PaperSize = ps;
}
}
report1.Document.Printer.PrinterSettings.Copies = _printcopies;
GrapeCity.ActiveReports.Data.OleDBDataSource ds = new GrapeCity.ActiveReports.Data.OleDBDataSource();
ds.ConnectionString = connString;
ds.SQL = sqlString;
report1.DataSource = ds;
report1.Run(false);
report1.Document.Print(false, false);
report1.Dispose();
|
|