How to show the progress of a printing-job?
Posted: Fri May 23, 2014 6:30 am
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:
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
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();
}
Cheers,
Pascal