我的代码在这里
private ReportDocument myReportDocument;
string reportPath = "";
crSales objRpt = new crSales();
SalesPrintModel model = new SalesPrintModel();
List<SalesPrintModel> lstSales = new List<SalesPrintModel>();
lstSales = GeneralFunctions.SALESLIST;
reportPath = Application.StartupPath + "\\crSales.rpt";
objRpt.Load(reportPath);
objRpt.SetDataSource(lstSales);
crystalReportViewer1.ReportSource = objRpt;
我想在角色纸(点阵打印机)上打印销售报告。纸张尺寸应根据要打印的行数动态设置。我找不到任何解决方案。
我阅读了MSDN中的ReportDocument Object
文章,该文章表明您可以使用属性。PrintOptions
在此MSDN文章中,以下成员列出了:
DefaultPaperOrientation, Landscape, Portrait
因此,您可以使用它们来更改纸张,并可以通过如下代码找到尺寸:
if (rows >= m && rows <= n)
objRpt.PrintOptions.PaperSize = aPaperSize;
我知道这不是一个完整的答案,但我认为它可以为您提供帮助
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句