How to show the progress of a printing-job?

Stimulsoft Reports.WPF discussion
Post Reply
User avatar
PJoyeux
Posts: 160
Joined: Tue Nov 26, 2013 9:40 am
Location: Germany

How to show the progress of a printing-job?

Post 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
Last edited by PJoyeux on Fri May 23, 2014 2:13 pm, edited 1 time in total.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

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

Post 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.
User avatar
PJoyeux
Posts: 160
Joined: Tue Nov 26, 2013 9:40 am
Location: Germany

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

Post 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
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

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

Post 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.
User avatar
PJoyeux
Posts: 160
Joined: Tue Nov 26, 2013 9:40 am
Location: Germany

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

Post by PJoyeux »

Thanks!

I'll take a look at this...

Pascal
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

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

Post by Alex K. »

Hello,

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

Thank you.
Post Reply