Click here to Skip to main content
15,918,109 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am using a Epson u220 printer and need to print Continues paper, when ever I generate invoice Report.

Now I have a hard time on how to set my Paper Size to Width = 5 and the Length to be a dynamic.

Meaning If the Data of the Invoice Report can fill up a Lenght 25 inches then the Custom paper size will be
5 X 25. and If the Data of the Invoice Report can fill up only to the length of 10 inches then the Custom paper size will be
5 X 10.

So is there anyway possible to set the Length of the Paper Size to be Dynamic. My Coding is:
C#
ReportDocument report = new ReportDocument();
report.Load(Server.MapPath("CrystalReport2.rpt"));
report.SetDatabaseLogon("sa", "amman", @"AMMAN-42796DF5F\SQLEXPRESS", "Medicals");
report.SetDataSource(dt); 
CrystalReportViewer1.ReportSource = report;
if (!IsPostBack)
{
  report.PrintToPrinter(1, false, 0, 0);
}
Posted
Updated 13-Apr-10 10:35am
v2

1 solution

Depending on your crystal reports version there is a second option to the 'printtoprinter' method.

One where you can pass a printersettings and a pagesettings object.
By manipulating the pagesettings object you might be able to do this but I'v never try'd it so can't be sure.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900