Clearing the Viewer
I have a form with a ppViewer, getting data from a ClientDataSet.
This form prompts the user for dates initially and on a button. If there
are no records for the dates requested initially, the viewer displays a
blank paper. If the user requests different dates, they will get the
records. But if the user makes a request where there are no records I
would like to clear the viewer of previous data. What I am getting are
the last good records still displayed. I assume the ClientDataSet no
longer has those records, but they are an image on the viewer, which is
actually a panel. I just don't see how to clear it.
This form prompts the user for dates initially and on a button. If there
are no records for the dates requested initially, the viewer displays a
blank paper. If the user requests different dates, they will get the
records. But if the user makes a request where there are no records I
would like to clear the viewer of previous data. What I am getting are
the last good records still displayed. I assume the ClientDataSet no
longer has those records, but they are an image on the viewer, which is
actually a panel. I just don't see how to clear it.
This discussion has been closed.
Comments
Try calling Viewer.Reset to clear out the report currently displayed.
Calling this should give you a blank report page. Also check out the
Report.NoDataBehavior to define what you would like to happen when there is
no data in your dataset.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com