Diferenças

Aqui você vê as diferenças entre duas revisões dessa página.

Link para esta página de comparações

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 - 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 bandThe band should be selected in the Object Inspector.+1. Clique no espaço em branco da banda de cabeçalho do grupoA banda deve ser selecionada no Object Inspector.
  
-2. Click on the Events tab of the Object ​Inspector and double-click on the BeforeGenerate ​eventAdd 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 fieldThe color is stored in a private variable of the form so that all of the report event handlers can use itThe recommendation ​label in the group header band is set to the colorFinallythe recommendation ​label caption is set using the FirstPage ​property of the groupIf FirstPage ​is Falsethen the group has overflowed onto an additional page.+**Nota:** Esta rotina recupera o valor do campo recommendation ​para uma string variable ​localEm seguida, atribui uma cor com base no valor do campoA cor é armazenada em uma variável privada do formulário de modo que todos os  eventos de relatórios podem usá-laO label "recommendation" na banda de cabeçalho do grupo está definido para esta corPor fima legenda do label recommendation" é definida utilizando a propriedade ​FirstPage ​do grupoSe FirstPage ​é falsaentã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 projectThe report should look like this:+10. Executar o projetoO relatório deve ser semelhante a este:
  
 {{ :​manual_usuario:​outros:​formatador_desenv_175.png?​600 |}} {{ :​manual_usuario:​outros:​formatador_desenv_175.png?​600 |}}