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

Counting specific records in a client data set.

edited August 2005 in General
Hi

I have a basic report that displays a list of units based on one client data
set.
In the summary section i wish to display a count of how many unit were at
location 0003 and another count of units that were at location 0009 and then
a total count.

The total count I can do if i set the text of a label to
ClientDataSet.RecordCount.
But I tried to set a varaible that counted the units when they were
displayed on the report but always ended up with an incorrect count.

What is the best way to do this?

Cheers
George

Comments

  • edited August 2005
    Hi George,

    Try placing one variable in the detail band of your report with its
    Visibility set to False. Then inside the OnCalc event of that variable
    update the value of two other variables located in your summary band.
    Something like the following...

    begin
    if (ppReport1.DataPipeline['Location'] = '0003') then
    ppVariable2.Value := ppVariable2.Value + 1
    else if (ppReport1.DataPipeline['Location'] = '0009') then
    ppVariable3.Value := ppVariable3.Value + 1;

    end;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.