protected void Printtest() { try { A4_Test Report = new A4_Test(); CrystalDecisions.Shared.PageMargins margin = Report.PrintOptions.PageMargins; margin.leftMargin = 0; // mmの指定をtwip単位に変換する margin.topMargin = 0; margin.bottomMargin = 0; //mmToTwip(marginLeft); margin.rightMargin = 0; Report.PrintOptions.ApplyPageMargins(margin); //Report.PrintOptions.PaperSize=PaperSize.; Report.PrintOptions.PrinterName = @"\\dataserver\Canon LBP2900"; Report.PrintOptions.DissociatePageSizeAndPrinterPaperSize = true; //Report.PrintToPrinter(0, false, 0, 0); ///Direct Printing var vwr = new Viewer(); vwr.CrystalReportViewer1.ReportSource = Report; vwr.ShowDialog(); } catch (CrystalReportsException ex) { MessageBox.Show(ex.ToString()); } }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { A4_Test rpt = new A4_Test(); rpt.Site = this.Site; return(rpt); }