Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Another report with funny variables :)

edited November 2001 in General
Hi, my next report:

On the report summary i'll have a variable with a calculated value... no
problem. But in each detail band i need a field of the detail divided by
the summary variable.
Something like:

Detail ->
MyField/VarOfTheSummary

Summary ->
VarOfTheSummary -> conditional SUM o another field of the detail.
How can i do that? Does the lookAhead property work for this?
thanks

--
Guillermo Castaño Acevedo
Gerente de Sistemas - Grupo Millennium Ltda
GuillermoC@GrupoMillennium.com
www.GrupoMillennium.com

Comments

  • edited November 2001
    You'll want to use a psTwoPass report so that in the second pass, you will
    have the report total to already be calculated when each detail band
    regenerates. There are a couple of boolean properties you can use in an if
    statement if you want to not execute code until the second pass,
    Report.FirstPass and Report.SecondPass.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited November 2001
    YEs, but i needed to use a trick. On the first pass of the summary variable i
    acumulated the value in a private delphi variable. Then, in the second pass of
    the detail variables i used the delphi variable.
    I can't use the value of the summary variable because it's reset before the
    second pass.
    All works fine in that way.
    Did i explain myself or was to confused?
    thanks

  • edited November 2001
    You could place a dbcalc in the header of your group , set lookaheaed
    property true and use it to div each value.
    If you don't wanna show it in the header make it visible := false;
    fd

  • edited November 2001
    It doesn't work directly because the dbcalc calculates itself with the detail,
    so in each detail calculation you'll result dividing by the current acumulated
    value but not for the report total.
    thanks

This discussion has been closed.