How to avoid a Preview Empty Page
Hi, When user clicks on a Print buttom on a form, it calls tppReport
Print method, and report is previwed on screen.
But sometimes there is no records to show, and preview screen is
completely empty. How can I avoid to show this empty screen, and show a
message like this:
'There is no records to process'
I've tried to put one or all of these lines on AfterOpenDataPipelines
report event, but with no success:
ppReportTest.Reset;
ppReportTest.Stop;
ppReportTest.CloseDataPipelines;
Thanks.
--- posted by geoForum on http://delphi.newswhat.com
Print method, and report is previwed on screen.
But sometimes there is no records to show, and preview screen is
completely empty. How can I avoid to show this empty screen, and show a
message like this:
'There is no records to process'
I've tried to put one or all of these lines on AfterOpenDataPipelines
report event, but with no success:
ppReportTest.Reset;
ppReportTest.Stop;
ppReportTest.CloseDataPipelines;
Thanks.
--- posted by geoForum on http://delphi.newswhat.com
This discussion has been closed.
Comments
Try using the TppReport.NoDataBehaviors property. This is a published
property available in the Delphi Object Inspector and gives you options to
display a message on the report or a message box when no data is present.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
options are correlated each others and there is no possibility to set
them all FALSE.
So, with no data I always get a single blank page displayed on the
standard Print Preview form, there is no possible combinations to avoid
it.
It's easy to check for no data AfterOpenDataPipelines, and then
displaying a message with code, but apparently there is no way to stop
the process and avoid the single blank page that follows it.
to
--- posted by geoForum on http://delphi.newswhat.com
What exactly would you like to happen? Why not just close the preview form
automatically if the no-data case is true?
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I would like the preview form not to be openened, since it is completely
blank
true?
How to do it automatically (without having to click on Close button)?
Thanks,
Roberto freitas
present.
show a
--- posted by geoForum on http://delphi.newswhat.com
You could check the datapipeline or dataset before calling Report.Print to
see if there is any data available. If not, then simply do not call
Report.Print and display a message.
Try:
Report.PreviewForm.Close;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
to see if there is any data available. If not, then simply do not call
Report.Print and display a message.
I can't do this way because I use BeforeOpenDataPipelines event to apply
custom parameter values to SQL and generate custom SQL.
I've tried it, but it doesn't close the blank preview page.
Anyway, I'll give all this stuff up, unless you have yet another
sugestion.
Thank you.
Roberto
completely
is
avoid
stop
published
options
tppReport
AfterOpenDataPipelines
--- posted by geoForum on http://delphi.newswhat.com