Results 1 to 6 of 6

Thread: Empty Reports

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2001
    Posts
    53

    Empty Reports

    Hi,

    Do enyone know how I can check if a report doesn't have any data?

    I have a routine that automatically created the reports then send them out. But, I've just noticed that it was sending out empty reports. Usually, when the recordset returns no data that the report is empty (with no data)....

    Thanks in advance for any help.....

  2. #2
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    You can always bring up the report in Crystal Report Writer and right click on a data filed and browse the data. If nothing is there, the there is no data.

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2001
    Posts
    53
    Hi,

    Do you know how to do it using VB code?
    I want to add this checking into my automation routine....

    Thanks.

  4. #4
    Lively Member Joffies's Avatar
    Join Date
    Aug 2002
    Location
    London
    Posts
    119

    Report Designer

    If you are using the Crystal Reports designer in your vb project you could use the the No_Data event. If you use crystal 8.5 developer you should have a sample called "No_Data_In_Report_Event" in your sample code folder. Let me know if you dont have it.

    Good Luck
    Last edited by Joffies; Aug 26th, 2003 at 04:44 AM.
    Do, or do not. There is no 'try'.

  5. #5

    Thread Starter
    Member
    Join Date
    Aug 2001
    Posts
    53
    Hi,

    Unfortunately I'm not using the designer...
    I use the Crystal report object to open up the report
    then export it as PDF....


    Here's portion of the code....*****************

    Set objCrystalApp = New CRAXDDRT.Application
    Set objCrystalReports = New CRAXDDRT.report
    Set objCrystalReports = objCrystalApp.OpenReport(repPath, 1)

    ExportOptions.FormatType = crEFTPortableDocFormat 'pdf
    ExportOptions.DiskFileName = strSaveTo & rstRep!RepCode & "_" & rstRep!JobID & ".pdf"

    objCrystalReports.Export False

    '*************************

  6. #6
    Lively Member Joffies's Avatar
    Join Date
    Aug 2002
    Location
    London
    Posts
    119
    Hallo

    Sorry to say that i cant find anythying else that checks for "no data" in a report.

    You will either have to make use of the designer or pass recordsets through code to your reports and then check if any data is present.



    If there is any other way i would really like to know tooo...Anybody else ....?

    Good Luck

    Last edited by Joffies; Aug 27th, 2003 at 10:05 AM.
    Do, or do not. There is no 'try'.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width