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_20_re_attach_event_handlers_stock_summary_subreport [2014/12/22 13:43]
administrador criada
manual_usuario:outros:formatadorrelatoriodesenv:fr_20_re_attach_event_handlers_stock_summary_subreport [2015/02/12 13:09] (atual)
administrador Aprovado
Linha 7: Linha 7:
  
  
-=====TUTORIAL DE RELATÓRIOS - C=====+=====TUTORIAL DE RELATÓRIOS - Conectando relatórios juntos com sub-relatórios de seção - Re-anexar os eventos para o sub-relatório de Resumo=====
 ---- ----
  
-1. Scroll to the top of the rbSectSR ​unit, doubleclick the class name TfrmSectionSubreports, ​and copy it into the clipboard.+1. Vá até a parte superior da unit rbSectSRdê um duplo clique no nome da classe ​TfrmSectionSubreports, ​e copiá-la para a área de transferência.
  
-2. Scroll down to the implementation section and Replace the existing classname ​(TfrmStockSummary) ​for each event handler with the new class name (TfrmSectionSubreports).+2. Vá até a seção de implementação e substituir o nome da classe existente ​(TfrmStockSummary) ​para cada evento com o novo nome da classe ​(TfrmSectionSubreports).
  
-3. Double-click on the rbSectSub ​report ​component to display the Report Designer.+3. Duplo clique no componente ​report ​rbSectSub para exibir o Report Designer.
  
-4. Click on the srStockSummary ​tab at the bottom of the Report Designer.+4. Clique na guia srStockSummary ​na parte inferior do Report Designer.
  
-5. Click in the white space of the group header band.+5. Clique no espaço em branco da banda de cabeçalho do grupo.
  
-6. Select the Events tab of the Object Inspector.+6. Selecione a guia Eventos do Object Inspector.
  
-7. Select the BeforeGenerate ​eventthen expand the drop-down ​list of event handlers and select this routine:+7. Selecione o evento ​BeforeGenerate, ​em seguida, expanda a lista drop-down ​de eventos e selecione essa rotina:
  
   ppGroupHeaderBand1BeforeGenerate   ppGroupHeaderBand1BeforeGenerate
  
-8. Select the AfterGenerate ​event to make sure the assignment was successful.+8. Selecione o evento ​AfterGenerate ​para garantir que a missão foi bem sucedida.
  
-9. Click in the white space of the detail band.+9. Clique no espaço em branco da banda de detalhe.
  
-10. Select the BeforeGenerate ​eventthen expand the drop-down ​list of event handlers and select this routine:+10. Selecione o evento ​BeforeGenerate, ​em seguida, expanda a lista drop-down ​de eventos e selecione essa rotina:
  
   ppGroupHeaderBand1BeforeGenerate   ppGroupHeaderBand1BeforeGenerate
  
-11. Select the AfterGenerate ​event to make sure the assignment was successful.+11. Selecione o evento ​AfterGenerate ​para garantir que a missão foi bem sucedida.
  
-12. Click in the white space of the group header band once again and double-click on the Before-Generate ​event to activate the code editor. ​Change the '​if' ​statement on the last line of the event handler to refer to srStockSummay ​instead of rbStock-Sum. ​The code should read:+12. Clique mais uma vez no espaço em branco da banda de cabeçalho do grupo e dê um duplo clique sobre o evento "Before-Generate" para ativar o code editor. ​Alterar o '​if' ​na última linha do evento para se referir a srStockSummay ​em vez de rbStock-Sum. ​O código deve ser assim:
  
   if srStockSummary.Report.Groups[0].FirstPage then   if srStockSummary.Report.Groups[0].FirstPage then
  
-**Note:** The original ​event handler referred to the rbStockSum ​report componentThis event handler has to be changed to refer to the Report ​component within the srStock ​subreportA subreport component ​ actually consists of two componentsthe subreport component and the report component contained within itThe subreport component is used to position the subreport within the parent report and to set various ​propertiesrelated ​to print behaviorThe report component is accessible via the Report ​property and contains the report itselfThis component is no different than the report component you work with on a Delphi ​form.+**Nota:** O evento ​original ​se refere ao componente relatório ​rbStockSum. ​Este evento tem de ser alterado para se referir ao componente ​Report ​dentro do sub-relatório ​srStock. ​O componente sub-relatório na verdade consiste de dois componenteso componente sub-relatório e o componente Report contido dentro deleO componente de sub-relatório é usado para posicionar o sub dentro do relatório pai e para fixar vários ​propertiesrelated ​para modos de impressãoO componente ​Report ​pode ser consultado através da propriedade Report e contém o próprio relatórioEste componente não é diferente do componente Report que você trabalha em um form Delphi.
  
-13. Scroll down to the summary band and reconnect the Variable ​components to their corresponding ​OnCalc ​events:+13. Desça até a banda de resumo e reconecte os componentes ​Variable ​para seus correspondentes eventos ​OnCalc:
  
   Component Event   Component Event
Linha 49: Linha 49:
   vrSellTotal vrSellTotalCalc   vrSellTotal vrSellTotalCalc
  
-**Note:** This tutorial ​illustrates how to reconnect the event handlers of the Stock Summary report so that you will better understand the situationIf we had copied these event handlers into the SectSub ​unit before we loaded the Stock Summary report into the subreportthe event handlers would be reconnected automatically by Delphi'​s object ​streaming ​logic. (You may recall that an error message stating that the event handlers could not be found was displayed when we loaded the report ​layout.) ​It is important to know that event handlers are reconnected based on their procedure nameWhen you want event handlers to reconnect automaticallythey must have the same names as those saved in the report ​layout.+**Nota:** Este tutorial ​mostra como se reconectar aos eventos do relatório de resumo de modo que você possa entender melhor a situaçãoSe tivéssemos copiado esses eventos para a unit SectSub antes de nós carregamos o relatório de resumo no sub-relatórioos eventos seriam reconectados automaticamente por objeto de streaming ​lógica do Delphi. (Você deve se lembrar que uma mensagem de erro informando que os eventos não puderam ser encontrados foi exibida quando nós carregamos o layout ​do relatório.) É importante saber que os eventos são reconectados com base no seu nome de procedimentoQuando você quer eventos para reconectar automaticamenteeles devem ter os mesmos nomes que os salvos no layout ​do relatório.
  
-14 Select ​File | Save from the Delphi main menu.+14 Selecione "File | Save" a partir do menu principal do Delphi.
  
-15. Run the ProjectThe Stock Summary report should now be color-coded and the totals should calculate properly.+15. Executar o projetoO relatório de resumo agora deve ser codificados por cores e os totais devem calcular corretamente.