Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Report no item match Post Reply Post New Topic
Author Message
chitemerere
Newbie
Newbie
Avatar

Joined: 04 Jul 2008
Location: Zimbabwe
Online Status: Offline
Posts: 29
Quote chitemerere Replybullet Topic: Report no item match
    Posted: 09 Jul 2008 at 2:59am
I have a crystal report running with a discrete parameter entry.  Is there a way of writing a code which informs the user that their parameter entry did not result in a match instead of having the report show a blank reportviewer with headers only?
 
Something like:
 

If (myReportDocument.Rows.Count = 0) Then

MsgBox("No matches for you MCC Approved search.", _

'MsgBoxStyle.OkOnly Or MsgBoxStyle.Exclamation, ProgramTitle)

End If

Many thanks and kind regards.

 

Chris
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 14 Jul 2008 at 1:20pm
There is no way to have a MsgBox appear.  However, you can use put information on the report that only appears when there's no data.
 
Put a text field in it's own section on the report.  In the text field, put something like the following:
 
The parameter {?parameter} did not return any data.
 
In the suppress formula for this section, put something like:
 
not IsNull({table.field that always has data})
 
This way, the message will display in the viewer instead of a blank report.
 
-Dell
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.016 seconds.