Diferenças
Aqui você vê as diferenças entre duas revisões dessa página.
Próxima revisão | Revisão anterior | ||
manual_usuario:outros:formatadorrelatoriodesenv:fr_18_code_calculations_totals [2014/12/19 14:30] administrador criada |
manual_usuario:outros:formatadorrelatoriodesenv:fr_18_code_calculations_totals [2015/02/10 14:36] (atual) administrador Aprovado |
||
---|---|---|---|
Linha 7: | Linha 7: | ||
- | =====TUTORIAL DE RELATÓRIOS - B - C===== | + | =====TUTORIAL DE RELATÓRIOS - Master / Detail - Relatório detalhado - Calculando os totalizadores===== |
---- | ---- | ||
- | 1. Select the vrItemTotal variable in the detail band. | + | 1. Selecione a variável vrItemTotal na banda de detalhes. |
- | 2. Select the Events tab of the Object Inspector. | + | 2. Selecione a guia Eventos do Object Inspector. |
- | 3. Double-click on the OnCalc event. An event handler shell will be generated in your Delphi form. | + | 3. Dê um duplo clique sobre o evento OnCalc. Uma classe de evento será gerada em seu form Delphi. |
- | 4. Add the following code to this event handler: | + | 4. Adicione o seguinte código para este evento: |
Value := plItem['Qty']*plPart['ListPrice']; | 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. | + | **Nota:** Este evento recupera a quantidade e lista dos preços dos itens e retorna o valor total por meio do parâmetro Value. O resultado será o valor do componente variable. O evento OnCalc irá disparar uma vez para cada item. |
- | 5. Return to the Report Designer and select the vrOrderTotal variable in the group footer band. | + | 5. Retorne ao Report Designer e selecione a variável vrOrderTotal na banda de rodapé de grupo. |
- | 6. Code the OnCalc event: | + | 6. Código do evento OnCalc: |
Value := Value + vrItemTotal.Value; | 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. | + | **Nota:** Este evento recupera o total corrente para o item e adiciona à execução total para a ordem. Este evento OnCalc também irá disparar uma vez para cada registro de item. |
- | 7. Return to the Report Designer, right-click over the vrOrderTotal variable, and select the Timing... menu option. | + | 7. Volte para o Report Designer, clique com botão direito sobre a variável vrOrderTotal, e selecionar Timing ... opção de menu. |
- | 8. Select 'GroupEnd' from the Reset On dropdown list. Select 'Group0: OrderNo' from the Group drop-down list. | + | 8. Selecione "GroupEnd 'para restabelecer a lista suspensa. Selecione 'Group0: OrderNo' da lista drop-down Group. |
- | **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. | + | **Nota:** O diálogo Timing permite que você controle quando o evento OnCalc dispara e quando o valor da variável será reposta. Para esse total, queremos calcular o valor de cada vez que um registro é atravessado e queremos redefinir o valor após o rodapé de grupo tenha concluído a impressão. |
- | 9. Select Project | Compile rbMDDProj. Fix any compilation problems. | + | 9. Selecione "Project | Compile rbMDDProj". Corrigir quaisquer problemas de compilação. |
- | 10. Select File | Save from the Delphi main menu. | + | 10. Select "File | Save" no menu do Delphi. |