Click here to Skip to main content
15,569,774 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,,


i am using crystal report to print a record in justbill.

it i printing well in crystal report viewer, when i use to show the viewer.

but i want to print the record without opening the report viewer.

i use the code " objRpt.PrintToPrinter(1,true, 0, 0)" to print directly but the data in paper is larger in size as i set in report viewer.

how to print the data without opening the report viewer.

Thanks Regards,
Sujay
Posted

Let try this:

C#
ReportDocument oRpt = new ReportDocument();
oRpt.Load(Server.MapPath("CrystalReport.rpt");

// You can change that you want
// that will be customize
oRpt.PrintOptions.PaperOrientation = [Shared].PaperOrientation.Portrait;
oRpt.PrintOptions.PaperSize = [Shared].PaperSize.PaperEnvelope10;



Then you use the code to printToPrinter
 
Share this answer
 
 
Share this answer
 
v2

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