Printing the total in the header |
Top Previous Next |
Usually you will print total values on the footer bands (such as data footer, group footer, etc). It's a natural printing order because when you print the total, its value is properly calculated and is ready to use. However, in some cases, you would need the total to be printed on the header (for example, on the group header). If you try to do this, you will see a zero value. At this moment, when you print a total, it is not calculated yet.
To solve this problem, FastReport has a feature called "delayed print". The "Text" object has a property called "ProcessAt" which can have one of the following values:
Let's look at how it works. Put the "Text" object which prints the total, on the group header. Set the "ProcessAt" property of the "Text" object to "GroupFinished":
When you run the report, FastReport will do the following:
The prepared report will be as follows:
Using other values of the "ProcessAt" property, you may print the report total in the report title (set ProcessAt = ReportFinished), or print the page total in the page header (set ProcessAt = PageFinished).
The delayed print feature will not work if you turn on the report file cache ("Report/Options..." menu, "Use file cache" checkbox). |