Navigation:  Contents > Developer FAQ > Preview >

StimulReport.Net Frequently Asked Questions

Print this Topic Previous pageReturn to chapter overviewNext page

How to attach your indicator of pages rendering?

For attaching your indicator of pages rendering you should use the Rendering event of the report. See below the example of the code:

 

C#

 

//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 Render method is called from False arguments.

//This argument indicates that there is no need to show progress of report rendering

report.Render(false);

 

//Show the rendered report

report.Show();

 

//The event which we are attaching

private void OnRendering(object sender, EventArgs e)

{

       StiReport report = sender as StiReport;

       string info = (report.PageNumber - 1).ToString();

}

 

 

VB

 

'Create a new report

Dim Report As New StiReport

Report.Load("report.mrt")

 

'Compile this report by all means

Report.Compile()

 

'Add to the Rendering event of a compiled report

AddHandler Report.CompiledReport.Rendering, New EventHandler(AddressOf Me.OnRendering)

 

'Start report rendering. Attention! The Render method is called from False arguments.

'This argument indicates that there is no need to show progress of report rendering

Report.Render(False)

 

'Show the rendered report

Report.Show()

 

'The event which we are attaching

Private Sub OnRendering(ByVal sender As Object, ByVal e As EventArgs)

       Dim Report As StiReport = CType(sender, StiReport)

       Dim Info As String = (Report.PageNumber - 1).ToString()

End Sub

 

 

Attention! You have to attach to the report.CompiledReport and only after this run the Compile method.