When you call the Print or Export method of the Report class, the boolean value passed to its showProgressionDialog parameter indicates whether the progress of the generation of the report should be displayed. Additionally, when either method is called, a GenerateReportProgression event is raised. The GenerateReportProgressionEventArgs object passed to the event handler contains progress information associated with the report that is being generated.
VB.NET |
Copy Code |
---|---|
Imports Xceed.Grid.Reporting Dim report As New Report( Me.gridControl1 ) AddHandler report.GenerateReportProgression, AddressOf Me.report_GenerateReportProgression report.Export( "D:\temp\test.html", ExportFormat.Html, True, False ) Private Sub report_GenerateReportProgression( ByVal sender As Object, _ ByVal e As GenerateReportProgressionEventArgs ) If e.ProgressionValue > 10 Then ' Do something End If If e.Status = GenerateReportStatus.Exporting Then ' Do something End If If e.ValueType = ProgressionValueType.PageNumber Then ' Do something End If End Sub |
C# |
Copy Code |
---|---|
using Xceed.Grid.Reporting; Report report = new Report( this.gridControl1 ); report.GenerateReportProgression += new GenerateReportProgressionEventHandler( report_GenerateReportProgression ); report.Export( "D:\\temp\\test.html", ExportFormat.Html, true, false ); private void report_GenerateReportProgression( object sender, GenerateReportProgressionEventArgs e ){ if( e.ProgressionValue > 10 ) { // Do something } if( e.Status == GenerateReportStatus.Exporting ) { // Do something } if( e.ValueType == ProgressionValueType.PageNumber ) { // Do something } } |
If you choose not to display the progression dialog, you should provide your own progress indicator in the GenerateReportProgression event handler. Otherwise, end-users may think that the application has stopped working.
The following table summarizes the properties available in GenerateReportProgressionEventArgs which can be used in the GenerateReportProgression event handler.
Property | Description |
---|---|
Cancel (inherited from CancelEventArgs) | Gets or sets a value indicating whether the report generation should be canceled. |
ProgressionValue | Contains an int value representing the total number of pages or row generated so far. |
Status | Contains a GenerateReportStatus value indicating whether the report is being prepared, printed or exported |
ValueType | Contains a ProgressionValueType value indicating the type of progression information used when generating the report (page number or row number). |