Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: display No Records Message Post Reply Post New Topic
Author Message
jbalbo
Senior Member
Senior Member
Avatar

Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Quote jbalbo Replybullet Topic: display No Records Message
     Posted: 06 Jan 2012 at 5:17am
Hi,
 
Does anyone know how I can display a "No records" message on a report if there is no data.
I would prefer to show in the details section, but will settle for the page header if I have to...
 
Thanks
Joe
 
IP IP Logged
jbalbo
Senior Member
Senior Member
Avatar

Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Quote jbalbo Replybullet Posted: 06 Jan 2012 at 5:35am
Actually just found this great write up:
I didn't put the link in because I wasn't sure if allowed on this fourm
 
Works great!!!

To build a report that uses this functionality, follow these steps:

  1. Create a formula named ‘Records’.
  2. Set the formula’s text to be:
    //Excute this formula as records are read into the report
    WhileReadingRecords;
    //define a variable that is available throughout the 'main' report
    Global Numbervar Records;
    //increment the variable
    Records:=Records+1;
  3. Place this field in the report’s Details section. Suppress the field by checking ‘Suppress’ check box on the Format Editor’s Common tab.
  4. Create a new Page Header section by right-clicking the Page Header section and choose ‘Insert Section Below’ from the context menu.
  5. Right-click the newly-created Page Header and choose ‘Section Expert…’ from the context menu. Check the ‘Underlay Following Sections’ checkbox.
  6. Click the Conditional-Formula Editory button to the right of the ‘Suppress’ checkbox. Set the formula’s text to:
    //If the field isn't null, suppress the section; the field will only be null when
    //the report does not contain data.
    Not(Isnull({@Records}))
  7. Add a Text Object to the report containing the desired message. Place the Text Object in the newly-created Page Header section.
  8. Test the report.
IP IP Logged
cyber-guys
Groupie
Groupie


Joined: 02 May 2008
Online Status: Offline
Posts: 42
Quote cyber-guys Replybullet Posted: 29 Jan 2012 at 8:58am
Great tip - I auto-generate lots of sales reports and such - occasionally there's a day that had no activity and the report doesn't go out  as a result - resulting in lots of user phone calls (to me of course)  I could use this to send an empty report that says as much
 
Thanks,
Cyber-guys
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum