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

Report Viewer and Conditional Printing of Report Objects

edited September 2004 in General
Hello,

I have a report in which I am conditionally printing graphic images, dbtext,
and shapes. I'm using the RecordPositionChange event of the datapipeline
component to change the visibility of each of these objects to true or
false, based upon data within each record. When I print directly to the
printer everythng works fine. But when I print to the report viewer, I lose
the visibility of the first record of the report. I've traced though the
program enough to find out that at the end of the report generation to the
report viewer, the dataset resets to the 1st record. This triggers the
RecordPositionChange event of the datapipeline. Even though my program is
setting the visibility of the images, dbtext, and shapes to true, they are
not visible for the 1st record only. Has the report engine already printed
(or skipped printing) the element before I've set the visibility to true? I
don't see how since I first set the visibility of all of the conditional
objects to false. Immediately after that, I then check the report data to
set the appropriate objects to visible = true.

Can you tell me what I've doing wrong?

What is your recommended method of conditionally printing report elements?

Thanks,

Al Willis

Comments

  • edited September 2004
    Hi Al,

    Sorry about the delay in this response. My news reader somehow lost your
    post. Instead of using the RecordPositionChange of the pipeline, try using
    the DetailBand.BeforePrint event of the report. This is the best event to
    use when toggling the visibility of any dynamic information being printed in
    a given band.

    --
    Best Regards,

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