Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Subreport, print "no records" message Post Reply Post New Topic
Author Message
bealem
Newbie
Newbie


Joined: 24 Feb 2010
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote bealem Replybullet Topic: Subreport, print "no records" message
    Posted: 29 Apr 2010 at 12:29am
Hi,

I've got a main report setup with 3 subreports.

The subreports are each in their own section with "New Page Before" checked so each subreport is on a new page.

What I want is to print out a message when a subreport has no records, rather than just getting the header and the rest of the page blank.

I see lots of posts about surpressing a subreport if no records, but I want it to print with a "no records" message.

How can I do this?

Cheers,
Mike
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 29 Apr 2010 at 3:29am
you could initialize a shared variable to 0, run the subreport (which updates the shared variable the record count) and if the count is still 0, display the message, otherwise, suppress the message and display the report..
 
the tricky part is the initializing of the variable...but you could create a new section and intialize it above the subreport...just will be creating a lot of sections...well you could initialize all the subreport variables at once, and if the subreports run after, say a group header, you could initialize them all there...so maybe not so many sections....
 
HTH
IP IP Logged
bealem
Newbie
Newbie


Joined: 24 Feb 2010
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote bealem Replybullet Posted: 30 Apr 2010 at 12:43am
Hi lockwelle,

Your post got me heading in the right direction.

After doing more searches about what you said, and looking at unboundfields (I guess that's what you meant) nothing was working right.

I then came across a post on another site that said to try and use a running total field that counted.

Inserted one of these for one of my fields, and then used the result to suppress (or not) the report footer that has the "no records" message.

Ta,
Mike
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.