Print Page | Close Window

Report no item match

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=3643
Printed Date: 13 May 2024 at 1:09pm


Topic: Report no item match
Posted By: chitemerere
Subject: Report no item match
Date 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



Replies:
Posted By: hilfy
Date 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


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window