Report Viewer and Conditional Printing of Report Objects
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
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
This discussion has been closed.
Comments
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.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com