neizl

Hi!

Is there any way that i could get the print button event in report viewer of crystal report XI

Your help is highly appreciated




Re: Crystal Reports for Visual Studio print button event in report viewer

SaswatiDas

Hi neizl,

I hv also this same query. Hv u found any solution to this If yes, plz mail me at saswdas@gmail.com






Re: Crystal Reports for Visual Studio print button event in report viewer

Zeeshan Umar

What you want to do after capturing this event tell in detail.

Normally i do not use the default buttons for crystal report viewer and add my custom fancy looking buttons.

Here is some code through which you can print reports

Code Snippet

private void PrintReport(string printerName)
{
PageMargins margins;

// Get the PageMargins structure and set the
// margins for the report.
margins = Report.PrintOptions.PageMargins;
margins.bottomMargin = 350;
margins.leftMargin = 350;
margins.rightMargin = 350;
margins.topMargin = 350;
// Apply the page margins.
Report.PrintOptions.ApplyPageMargins(margins);

// Select the printer.
Report.PrintOptions.PrinterName = printerName;

// Print the report. Set the startPageN and endPageN
// parameters to 0 to print all pages.
Report.PrintToPrinter

}