manual_usuario:outros:formatadorrelatoriodesenv:fr_05_conditional_grand_total

Essa é uma revisão anterior do documento!


<fs x-large>Formatador de Relatório - ReportBuilder (Resumo do guia do desenvolvedor)</fs>

CÓDIGO - Execução de cálculos - Conditional Grand Total


To exclude certain values from a grand total, add a Variable component to the summary band. Then code the OnCalc event handler as:

Procedure TForm1.ppVariable2Calc(Sender: TObject; var Value: Variant);
var
  lcValue: Currency;
begin
  lcValue := Table2.FieldByName('AmountPaid').AsCurrency;
  if (lcValue >= 5000) then
    Value := Value + lcValue;
end;

This event handler will accumulate the value of the variable only when the amount paid is greater than $5,000. The screen shot below shows the result. Notice that this report also has a conditional group total in the group footer band.

manual_usuario/outros/formatadorrelatoriodesenv/fr_05_conditional_grand_total.1418304753.txt.gz · Última modificação: por administrador