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

Supressing detail items

edited March 2005 in Subreports
Is there a way to supress output of individual rows in a detail band?

Like..

if this = 'condition' then
Report.Detail.SkipThisRow;

etc.

CT

Comments

  • edited March 2005

    if condition then
    Report.Detail.Visible := False
    else
    Report.Detail.Visible := True;


    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited March 2005
    > > Is there a way to supress output of individual rows in a detail band?


    Nard,

    I went in that direction but say if the condition of #2 out of 3 records was
    to be hidden, the entire details section was hidden (all #1-3). I'm talking
    more about 'skipping rows'. Does this still apply? Maybe I'm not doing
    something right here. My temporary fix has been to set the height to .001
    and then back to normal, etc.

    CT
  • edited April 2005

    1. Use the Band.BeforePrint event

    2. Implement the event-handler exactly as I demonstrated, making sure that
    each time the event fires, you evaluate the condition and explicitly set the
    visibility to true or false. Keep in mind that the the report, bands, and
    elements are all objects. If you set Band.Visible to False in your
    event-handler, the band will not print until you set the property back to
    true.

    Implementing what I describe will result in a report that evaluates each
    record and then conditionally prints detail rows.

    An alternative solution is to use a SQL query to select only the records
    that should be included in the report. This technique is preferrable.
    Performance will be better on the data access side of things and on the
    report processing side of things, and the report will be simpler.


    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.