|
This event is use by the reporting engine (see interface IWPReport). (The product RTF2PDF does not yet support reporting!)
Declaration C#
OnReportState(object Sender, string Name, int State, WPDynamic.IWPReportBand Band, ref bool Abort)
Declaration OCX
OnReportState(ByVal Name As String, ByVal State As Long, ByVal Band As WPTDynInt.IWPReportBand, Abort As Boolean)
This event occurs during report creation. It gives you a chance to prepare a database query, to advance to the next record and to prepare the attributes of the bands.
This simplified C# example code loops all groups in the report 10 times.
private void wpdllInt1_OnReportState(
object Sender, string Name,
int State, WPDynamic.IWPReportBand Band,
ref bool Abort)
{
if (State==WPDynamic.commands.REP_BeforeProcessGroup)
Abort = Band.Count>10;
else Abort = false;
}
If you are using the Active-X and your developing system does not provide access to the interface passed as parameter, use the property EventReportBand instead.
|
Name
|
This is the name of the band.
|
State
|
The parameter state is used to check the current processing state of the reporting engine:
0 (REP_BeforeProcessGroup): A reporting group is about to be started/looped. You need to set "Abort" to false, otherwise the group will not be processed. Usually you will need to prepare a sub query and set "Abort" to true in case the query is empty.
The event will also occur when the group is processed again - Count is >0 in this case.
1 (REP_PrepareText): A text band is prepared. It will be used next. Usually you have nothing to do - but you can modify the properties of the band paragraphs.
After the band was prepared, all paragraphs will be copied to editor #2 in the TextDynamic control and after that the event OnFieldGetText will be fired for all merge fields in the text.
2 : not used
3 (REP_PrepareHeader): A header band is prepared.
4 : not used
5 (REP_AfterProcessGroupData): The group data has been processed completely. You can use this state to sum up totals.
6 (REP_PrepareFooter): A footer band is prepared.
7: not used
8 (REP_AfterProcessGroup): The group was processed. You can use this event to move to next record.
|
Category
Reporting
|