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

Skipping records that meet a certain criteria

edited November 2003 in General
Using ppDBPipeline, I need to prevent records with value = 0 from printing.
I can't figure out which event to intercept, and which component to make invisible.
I can't use a query as a datasource, I am sharing a TMemoryData datasource.

Any ideas?

Comments

  • edited November 2003
    Hi Will,

    How are you displaying Field1 in your report? (ie. DBText, DBMemo,
    TppVariable). You should be able to use the DetailBand.OnBeforePrint event
    to check the value of Field1 before it prints and suppress that printing if
    its value is 0. You can suppress the printing either by setting the actual
    component's visibility to False or by setting the entire band's visibility
    to False. Remember to reset the Visibility to True once you are done or it
    will never show up again.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2003
    Hi Nico

    The field is a ppDBText

    I tried to set the visibility of the DetailBand in the DetailBand.OnBeforePrint event

    if Pipeline['Count'] = 0 then DetailBand.Visible := False else DetailBand.Visible := True;

    but the band never appeared. When debugging, the value always evaluated to 0, so I guess this is the problem. Maybe there is something about the way I am referencing the Value. I'll have another look now I know I am on the right track.

    Thanks

    Will

    Hi Will,

    How are you displaying Field1 in your report? (ie. DBText, DBMemo,
    TppVariable). You should be able to use the DetailBand.OnBeforePrint event
    to check the value of Field1 before it prints and suppress that printing if
    its value is 0. You can suppress the printing either by setting the actual
    component's visibility to False or by setting the entire band's visibility
    to False. Remember to reset the Visibility to True once you are done or it
    will never show up again.

    --
  • edited November 2003
    Thanks Nico

    I have it working nicely now, I was referencing the field value incorrectly

    Will

    Hi Will,

    How are you displaying Field1 in your report? (ie. DBText, DBMemo,
    TppVariable). You should be able to use the DetailBand.OnBeforePrint event
    to check the value of Field1 before it prints and suppress that printing if
    its value is 0. You can suppress the printing either by setting the actual
    component's visibility to False or by setting the entire band's visibility
    to False. Remember to reset the Visibility to True once you are done or it
    will never show up again.

    --
This discussion has been closed.