Essa é uma revisão anterior do documento!
Formatador de Relatório - ReportBuilder (Resumo do guia do desenvolvedor)
TUTORIAL DE RELATÓRIOS - B - C
1. Select the vrItemTotal variable in the detail band.
2. Select the Events tab of the Object Inspector.
3. Double-click on the OnCalc event. An event handler shell will be generated in your Delphi form.
4. Add the following code to this event handler:
Value := plItem['Qty']*plPart['ListPrice'];
Note: This event handler retrieves the quantity and list price of the item and returns the total amount via the Value parameter. The result will become the value of the variable component. The OnCalc event will fire once for each item record.
5. Return to the Report Designer and select the vrOrderTotal variable in the group footer band.
6. Code the OnCalc event:
Value := Value + vrItemTotal.Value;
Note: This event handler retrieves the current total for the item and adds it to the running total for the order. This OnCalc event will also fire once for each item record.
7. Return to the Report Designer, right-click over the vrOrderTotal variable, and select the Timing… menu option.
8. Select 'GroupEnd' from the Reset On dropdown list. Select 'Group0: OrderNo' from the Group drop-down list.
Note: The Timing dialog allows you to control when the OnCalc event will fire and when the variable value will be reset. For this total, we want to calculate the value each time a record is traversed and we want to reset the value after the group footer has completed printing.
9. Select Project | Compile rbMDDProj. Fix any compilation problems.
10. Select File | Save from the Delphi main menu.