How do the Printed and Printing events from StiReport work?
Posted: Mon Mar 06, 2017 9:40 am
Hello, in my application, I send my report to print, but I would like to know if the report has been succesfully printed. I have tried to use the event Printed of the class StiReport, but it does not get triggered, I am not sure how it works. My code is something like this:
I put a breakpoint in Report_Printing and Report_Printed, but it seems when the report is sent to print, the events are not launched. How do they work? Is there any documentation about it? I could not find any example.
Thank you.
Code: Select all
StiPrintReport stiPrintReport;
StiReport report;
public async Task PrintReportAsync()
{
report = await GetReportToPrintAsync(); //This methods get the report I want, prepared to be printed
report.Printing += Report_Printing;
report.Printed += Report_Printed;
stiPrintReport = new StiPrintReport(report);
stiPrintReport.RegisterForPrinting();
await stiPrintReport.PrintAsync();
}
private void Report_Printing(object sender, EventArgs e)
{
throw new NotImplementedException();
}
private void Report_Printed(object sender, EventArgs e)
{
throw new NotImplementedException();
}
Thank you.