Diferenças

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

Link para esta página de comparações

Ambos lados da revisão anterior Revisão anterior
Próxima revisão
Revisão anterior
manual_usuario:outros:formatadorrelatoriodesenv:fr_14_assign_event_handlers_oncalc_variable_components [2015/01/07 13:04]
administrador
manual_usuario:outros:formatadorrelatoriodesenv:fr_14_assign_event_handlers_oncalc_variable_components [2015/02/02 14:58] (atual)
administrador Aprovado
Linha 7: Linha 7:
  
  
-=====TUTORIAL DE RELATÓRIOS - C=====+=====TUTORIAL DE RELATÓRIOS - Grupos, cálculos e da Banda Summary ​Atribuir o evento OnCalc dos componentes Variable=====
 ---- ----
  
-1. Select the vrBuyTotal ​variable. +1. Selecione a variável ​vrBuyTotal.
- +
-2. Click on 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. Assign the following code to this event handler: 4. Assign the following code to this event handler:
Linha 20: Linha 16:
 2. Clique na guia Eventos do Object Inspector. 2. Clique na guia Eventos do Object Inspector.
  
-3. Dê um clique duplo sobre o evento OnCalc. Um shell manipulador de eventos ​será gerado em seu formulário de Delphi.+3. Dê um clique duplo sobre o evento OnCalc. Um evento ​shell será gerado em seu formulário de Delphi.
  
-4. Atribua o seguinte código para este manipulador de eventos:+4. Atribua o seguinte código para este evento:
  
   if(qryStock.FieldByName('​Rcmndation'​).AsString = '​BUY'​) then   if(qryStock.FieldByName('​Rcmndation'​).AsString = '​BUY'​) then
     Value := Value + 1;     Value := Value + 1;
  
-5. Assign the following code to the OnCalc ​event of the vrHoldTotal ​variable:+5. Atribuir o seguinte código ao evento ​OnCalc ​da variável ​vrHoldTotal:​
  
   if(qryStock.FieldByName('​Rcmndation'​).AsString = '​HOLD'​) then   if(qryStock.FieldByName('​Rcmndation'​).AsString = '​HOLD'​) then
     Value := Value + 1;     Value := Value + 1;
  
-6. Assign the following code to the OnCalc ​event of the vrSellTotal ​variable:+6. Atribuir o seguinte código ao evento ​OnCalc ​da variável ​vrSellTotal:​
  
   if(qryStock.FieldByName('​Rcmndation'​).AsString = '​SELL'​) then   if(qryStock.FieldByName('​Rcmndation'​).AsString = '​SELL'​) then
     Value := Value + 1;     Value := Value + 1;
  
-**Note:** All three of these event handlers check the field value to make sure it corresponds to the total and then increment the total. The OnCalc event is a procedure where the Value parameter contains the current value of the variable. These particular variables are integers because we set the DataType to Integer when we created them. +**Nota:** Todos esses três eventos ​verificam ​o valor do campo para se certificarem ​que correspondem ​ao total e, em seguida, ​aumenta-lo. O evento OnCalc é um procedimento em que o parâmetro ​Value contém o valor atual da variável. Essas variáveis particulares são inteiras, porque vamos definir o DataType ​para inteiro quando os criarmos.
- +
-** Nota: ** Todos esses três manipuladores de eventos ​verificar ​o valor do campo para se certificar de que corresponde ​ao total e, em seguida, ​aumentar o total. O evento OnCalc é um procedimento em que o parâmetro ​do valor contém o valor atual da variável. Essas variáveis particulares são inteiros, porque vamos definir o tipo de dados para inteiro quando os criamos. +
- +
-7. Select File | Save from the Delphi main menu. +
- +
-8. Select Project | Compile rbSTProj from the Delphi main menu. Fix any problems.+
  
-9Run the project.+7Selecione a opção de menu "File | Save".
  
-10Preview the reportClick on the Last Page icon of the Print Preview window. A thirty-eight page report should appear. The summary band should contain totals for each recommendation type.+8Selecione a opção de menu do Delphi "​Project | Compile rbSTProj"​Corrija os problemas.
  
-**Note:** You must compile and run this report in order to see exactly what it will look likeThis is because event handlers have been assigned to the report. When event handlers are assigned, the report must be compiled and run; otherwise, the event handler code will not be used when generating the report and any changes made via the event handlers will not be reflected in the report.+9Execute o projeto.
  
 +10. Visualize o relatório. Clique no ícone "Last Page" da janela visualização. Um relatório de trinta e oito página deve aparecer. A banda resumo deve conter os totais de cada tipo recommendation.
  
-10. Visualize o relatório. Clique no ícone da última página da janela ​de pré-visualizaçãoUm relatório ​de trinta e oito página deve aparecerA banda resumo deve conter ​os totais de cada tipo de recomendação.+**Nota:** Você deve compilar e executar este relatório, a fim de ver exatamente como ele vai ficarIsso ocorre porque os eventos foram atribuídos ao relatório. ​Quando ​os eventos são atribuídos,​ o relatório deve ser compilado e executado; caso contrário, o código dos eventos não serão utilizados na geração do relatório e quaisquer mudanças feitas através dos eventos não serão refletidos no relatório.
  
-** Nota: ** Você deve compilar e executar este relatório, a fim de ver exatamente o que ele vai ficar. Isso ocorre porque os manipuladores de eventos foram atribuídos ao relatório. Quando os manipuladores de eventos são atribuídos,​ o relatório deve ser compilado e executado; caso contrário, o código de manipulador de eventos não serão utilizados na geração do relatório e quaisquer mudanças feitas através dos manipuladores de eventos não serão refletidas no relatório.