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

Determining duplicate data, and excluding from report

edited September 2005 in General
I'm trying to filter out duplicate data. Here's the situation:

Data is being injected into the database from automated equipment. This
data consists of test results and quite often the same results will get
injected more than once.

I need to filter out the duplicate data, and would like to do so based
on data of injection if possible. So for example I have four different
chemical results from test a and they get injected into the databse
twice on 9/12/2005, and twice on 8/4/2005, but only once on the
remaining 9 dates. I don't know a head of time which dates have
duplicate or not, but need to filter them out for these reports that are
gathering 90 days worth of the test results.

Could I do some sort of calculation based on some sort of variable I
could set to test for duplication of one result by date to drop the
second instance of all results for that date?

I'm really new at this so am at a loss as to how to proceed.



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited September 2005
    Hi,

    Try setting the SuppressRepeatedValues property of the TppDBText component
    to True. This will not show a repeated value of the chemical result if they
    are the same.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2005
    Thanks for your reply, it has me close to a resolution. A couple of
    questions remain:

    Will this suppress the values if they occur on a different date? If so
    then this will not work, so I would need a different approach.

    If I set this property for each item in the row I then get an empty row.
    Is there some way to eliminate that empty row when it occurs?

    component
    they
    This
    get
    are



    --- posted by geoForum on http://delphi.newswhat.com
  • edited September 2005
    I was able to eliminate the empty lines and to make sure I didn't lose
    duplicate numbers from different dates so that is very good. The last
    problem I ahve found is that if I have different sets of data from the
    same date, but that is not duplicated I lose the date at the beginning
    of the row since it is a duplicate.

    I have a feeling I will have to live with this but is there some way to
    either as a calc or in the dataset definitions to check for duplication
    of mutiple items in the row before hiding all items in that row?

    Again, thanks for the data so far!

    Thanks for your reply, it has me close to a resolution. A couple of
    row.
    if
    based
    different



    --- posted by geoForum on http://delphi.newswhat.com
  • edited September 2005
    Hi,

    If you place all the objects in your detail band in a TppRegion you can
    easily check the values of separate fields using the Band.BeforePrint event
    then set the entire row's Visibility to false by setting the
    TppRegion.Visibility to False.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2005
    I'm afraid I don't understand how to do what you describe. Sorry, but
    thanks for the advice.

    event



    --- posted by geoForum on http://delphi.newswhat.com
  • edited September 2005
    Hi,

    Sorry, I will explain a bit further.

    Try placing a TppRegion inside the detail band of a new report. Then place
    as many objects as you like inside the TppRegion boundaries (excluding other
    regions). Now you have control over the visibility of all of those
    components visibility just by toggling the visibility of the TppRegion. For
    instance say for each detail line in your report you had a
    TppLabel/TppDBText pair. But for certain values of the DBText, you want to
    remove both the label and DBText. If you place both objects in a TppRegion,
    you can automatically toggle the visibility of both with one line of code.

    procedure TForm1.ppDetailBand1BeforePrint(Sender: TObject);
    begin
    if ppReport1.DataPipeline['CustomerNumber'] > 100 then
    ppRegion1.Visibility := False
    else
    ppRegion1.Visibility := True;

    end;

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2005
    Awesome. I really appreciate the expanded answer!



    --- posted by geoForum on http://delphi.newswhat.com
This discussion has been closed.