FastReport: Summary on ReportTitle
I have a report with these parts:
ReportTitle
ColumnHeader MasterData ColumnFooter ReportSummaryHow can I display sum of a field in MasterDat开发者_运维百科a on ReportTitle?
I can see two possible ways:
Via a report variable:
Calculate the total separately.
Pass the total to the report using a report variable (and, possibly, the
TfrxReport.OnGetValue
event).
Via the
DoublePass
property of the report:Set the
TfrxReport.EngineOptions.DoublePass
property toTrue
.Calculate the total in the report script and store it to a script variable on the first pass
Fill the memo from the variable on the second pass.
Use
Engine.FinalPass
in the script to detect whether it's the final (second) pass.
- Define a variable for sumatory
- Asign sumatory to variable on first pass of report
- Show variable on second pass
Or, if the sumatory is result of a query, get this result and show it
精彩评论