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

Grouping on Variable

edited May 2002 in General
ReportBuilder Std for D5, demo version Access2K,ADO

Just getting started with this demo, using a simple db;
ClientID,OrderNo,JobDate etc. Using DecodeDate function to set a ppVariable
to Year and second to Month and thus trying to group on ppVariableYear then
ppVariableMonth however despite trying various settings for 'reset' the
variable only seems to reset on 'newpage' - also tried using only
ppVariableYear -
Obviously I'm missing something?
(Trying to produce a jobreport grouped on year then month,the detail being
in the month grouping)

Regards,David

Comments

  • edited May 2002
    Having found a similar Q, as I understand it you should not try to group on
    a calc.variable but order the underlying table, and go from there?
    David
  • edited May 2002
    Though you can group on a variable it might be a better idea sort the data
    set. Lots of dbs provide MONTH and YEAR functions for extracting those
    values as separate fields or something similar. You would then SORT by year
    and then by month. This way all you have to do is create two groups, one on
    the calculated year field and one on the calculated month field. If you
    must group on the variable keep in mind that the report does not sort the
    data for you. You can use the Timing dialog to set the reset point or reset
    the variable manually in an event handler.

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

  • edited May 2002
    You need to set the variable's value in its OnGetText event and not its
    OnCalc event. This is the only time in which you should not use the OnCalc
    event to perform a calculation. The timing of the OnCalc is not compatible
    with the group's timing for whether or not it will break to the next group.


    Cheers,

    Jim Bennett
    Digital Metaphors

    "Alexander Kramnik (Digital Metaphors)" wrote
This discussion has been closed.