Page 1 of 1

How to show the progress of a printing-job?

Posted: Fri May 23, 2014 6:30 am
by PJoyeux
Hi,

I want to show the progress of my printing-jobs regardless whether I print using "PrintToWpf()" or "PrintToDotMatrixPrinter()".

In your documentation I found this code which seemed to do exactly what I wanted:

Code: Select all

//Create a new report
StiReport report = new StiReport();
report.Load("report.mrt");
//Compile this report by all means
report.Compile();
//Add to the Rendering event of a compiled report
report.CompiledReport.Rendering += new EventHandler(this.OnRendering);
//Start report rendering. Attention! The RenderWithWpf method is called from False arguments.
//This argument indicates that there is no need to show progress of report rendering
report.RenderWithWpf(false);
//Show the rendered report
report.ShowWithWpf();
//The event which we are attaching
private void OnRendering(object sender, EventArgs e)
{
StiReport report = sender as StiReport;
string info = (report.PageNumber - 1).ToString();
}
I have tried to get this to run on my side but my event never gets fired. When and/or under which circumstances is this event fired?

Cheers,
Pascal

Re: Hot to show the progress of a printing-job?

Posted: Fri May 23, 2014 1:41 pm
by HighAley
Hello.

This code show rendering of report, but you need printing.
We pass printing job to .Net Framework. Could you specify what progress do you need to see? How do we pass report to .Net Framework or of whole printing of the report?

Thank you.

Re: How to show the progress of a printing-job?

Posted: Fri May 23, 2014 2:24 pm
by PJoyeux
I don't need to know how many pages have actually been printed by the printer, but when we print some 100 records resulting in 100 pages the user stares at the screen until your engine has done its job and sent the whole job to the printer.

I would like to "tell" the user how much of the work has already been done by the enginge, pagewise.

I hope you understand what I mean...

Pascal

Re: How to show the progress of a printing-job?

Posted: Mon May 26, 2014 9:36 am
by Alex K.
Hello,

The progress is not available, but you can check the following event
StiOptions.Engine.GlobalEvents.InvokeReportPrintingPage(this, ee);
where ee it is
StiPrintPageEventArgs(int currentPage, int fromPage, int toPage)

Thank you.

Re: How to show the progress of a printing-job?

Posted: Mon May 26, 2014 10:03 am
by PJoyeux
Thanks!

I'll take a look at this...

Pascal

Re: How to show the progress of a printing-job?

Posted: Mon May 26, 2014 12:45 pm
by Alex K.
Hello,

Ok.
Let us know if you need any additional help.

Thank you.