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_14_code_beforegenerate_event_group_header [2014/12/17 12:52] administrador criada |
manual_usuario:outros:formatadorrelatoriodesenv:fr_14_code_beforegenerate_event_group_header [2015/01/27 15:05] (atual) administrador Aprovado |
||
---|---|---|---|
Linha 7: | Linha 7: | ||
- | =====TUTORIAL DE RELATÓRIOS - B - C===== | + | =====TUTORIAL DE RELATÓRIOS - Grupos, cálculos e da Banda Summary - Código do evento BeforeGenerate da banda de cabeçalho do grupo===== |
---- | ---- | ||
- | 1. Click in the white space of the group header band. The band should be selected in the Object Inspector. | + | 1. Clique no espaço em branco da banda de cabeçalho do grupo. A banda deve ser selecionada no Object Inspector. |
- | 2. Click on the Events tab of the Object Inspector and double-click on the BeforeGenerate event. Add the code shown below to the event handler. | + | 2. Clique na guia Eventos do Object Inspetor e clique duas vezes sobre o evento BeforeGenerate. Adicione o código mostrado abaixo. |
- | **Note:** This routine retrieves the value of the recommendation field into a local string variable. It then assigns a color based on the value of the field. The color is stored in a private variable of the form so that all of the report event handlers can use it. The recommendation label in the group header band is set to the color. Finally, the recommendation label caption is set using the FirstPage property of the group. If FirstPage is False, then the group has overflowed onto an additional page. | + | **Nota:** Esta rotina recupera o valor do campo recommendation para uma string variable local. Em seguida, atribui uma cor com base no valor do campo. A cor é armazenada em uma variável privada do formulário de modo que todos os eventos de relatórios podem usá-la. O label "recommendation" na banda de cabeçalho do grupo está definido para esta cor. Por fim, a legenda do label recommendation" é definida utilizando a propriedade FirstPage do grupo. Se FirstPage é falsa, então o grupo tem gerado uma página adicional. |
{{ :manual_usuario:outros:formatador_desenv_174.png?600 |}} | {{ :manual_usuario:outros:formatador_desenv_174.png?600 |}} | ||
- | 3. Scroll up in the Code Editor and add the following code to the 'private' section of the form class declaration: | + | 3. Role para cima no Code Editor e adicione o seguinte código para a seção "privade" da declaração de classe do formulário: |
FRecommendationColor: TColor; | FRecommendationColor: TColor; | ||
- | 4. Select View | Toggle Form/Unit from the Delphi main menu. | + | 4. Selecione "View | Toggle Form/Unit" no menu do Delphi. |
- | 5. Select the Standard tab of the Delphi Component palette. | + | 5. Selecione a guia Standard da paleta de componentes do Delphi. |
- | 6. Create a button on the form. | + | 6. Crie um botão no form. |
- | 7. Configure the button: | + | 7. Configure o botão: |
Name btnPreview | Name btnPreview | ||
Caption Preview | Caption Preview | ||
- | 8. Add the following code to the OnClick event for the button: | + | 8. Adicione o seguinte código para o evento OnClick do botão: |
rbStock.Print; | rbStock.Print; | ||
- | 9. Select File | Save from the Delphi main menu. | + | 9. Selecione "File | Save" no menu do Delphi. |
- | 10. Run the project. The report should look like this: | + | 10. Executar o projeto. O relatório deve ser semelhante a este: |
{{ :manual_usuario:outros:formatador_desenv_175.png?600 |}} | {{ :manual_usuario:outros:formatador_desenv_175.png?600 |}} | ||