1
votes

My Code Here

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;

I Want to print the Sales Report on Role Paper(Dot Matrix Printer). The Size of the paper should set dynamically as per the number of lines to be print.I cant find any solution.

1
What is your question?Joe White
Your Question is Not Clear. What is your Problem? Are you getting any error? just clear ituser4093832
I want to Print my Accounts Bill on Role Paper the paper size need to set dynamically as per the number of lines (Number of Qty).Arjun Prakash

1 Answers

2
votes

I read the ReportDocument Object Article in MSDN, That shows you can use a PrintOptions properties.

And in this MSDN Article, below members listed:

  • PaperSize: Sets the current printer paper size.
    Valuse are listed Here.
  • PaperOrientation: Sets the current printer paper orientation.
    Values are DefaultPaperOrientation, Landscape, Portrait

So you can use them to change your paper, and you can find your size by a code like this:

if (rows >= m && rows <= n) 
   objRpt.PrintOptions.PaperSize = aPaperSize;

I know this is not a full answer but I think it can help you