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

No data behaviour with in-built preview window

edited March 2003 in General
Hi All,

I am using the in-built preview window and the 'ndMessageDialog' no data
behaviour. Currently it shows the preview window then shows the no data
message. Is there a way to show this dialog, without the preview window
being shown.

It just seems silly popping up a whole preview window only to tell you there
is nothing in it.

--
Cheers
Dave

Comments

  • edited March 2003
    You're inside of a call to Report.Print. The device type is set to screen.
    The report is going to create a preview form, then a no data dialog. One way
    to do it is to check for no data before printing the report and selectively
    call Report.Print. Call Report.Datapipeline.Open and then check to see if
    ppdaNoRecords is in DataPipeline.State property. If you are using a Dade
    based report, then here is a simple example which shows how to open a
    pipeline in Dade at runtime:
    http://www.digital-metaphors.com/tips/NoPreviewWhenNoData.zip

    If you are using the autosearch feature, then you won't be able to hide the
    preview form, because you will want to reenter the autosearch criteria as a
    user by hitting the autosearch button in the preview form in order to
    resubmit search criteria in hopes of getting data:)


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited March 2003
    Thanks Jim, I'll give it a go.

    I had thought about checking the dataset (pipeline) before a preview, but I
    thought it would be nicer to use the stuff already built in. Saying that,
    it's only going to be a few lines anyway.
This discussion has been closed.