Essa é uma revisão anterior do documento!
Formatador de Relatório - ReportBuilder (Resumo do guia do desenvolvedor)
TUTORIAL DE RELATÓRIOS - B - C
1. Close the Report Designer.
2. Locate the drop-down list of components at the top of Object Inspector.
3. Select the Detail band in this list (it should be named ppDetailBand1).
4. Select the Events tab and double click on the BeforeGenerate event.
5. Place the following code in the event handler:
BuildEmployeeAddress(mmEmployeeAddress1.Lines); BuildEmployeeAddress(mmEmployeeAddress2.Lines);
6. Scroll up to the form class declaration. Replace the private declarations comment with the following procedure declaration:
procedure BuildEmployeeAddress(aStrings: TStrings);
7. Scroll down below the DetailBand BeforeGenerate event handler and insert the code shown below as the BuildEmployeeAddress procedure.
Note: In this event handler we need to build the same address for two different memo components. In order to accomplish this, we can create a general routine (BuildEmployeeAddress) that we can call for each component, or we can build the address in a local string variable and then assign it to both components. We chose the latter approach for readability.
Note: This routine simply retrieves each element of the Employee's address, concatenating and storing the result in the TStrings object passed in the parameter. The 'if' statements check for empty strings, ensuring that no blank lines will appear in the address.