Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Message at Group Header if Blank

Status
Not open for further replies.

edison1135

Technical User
Mar 28, 2001
24
0
0
US
I'm using Crystal Reports 7 with a MDB database. I have a report that is grouped on Marketing Managers, and the report lists the wins for each manager. If a Manager had no wins for the period, his/her name is not displayed. I want to be able to add a stagement which will automatically display for any manager who has no wins.

"John Doe had no wins for the period."

I tried different variations of the IsNull statement, but can't get anything to display if there were no wins.

if isnull(GroupName ({BID_SUBJ.MARKETING_MANAGER})) then "No Awards"
else ToText(GroupName ({BID_SUBJ.MARKETING_MANAGER}))

Thanks,

Edison1135


 
You have to get a record for every manager. One way is to start with the manager table and do an outer join to the other tables. However, if you put criteria on the outer table you nullify the outer join.

Or, you could include wins and losses in the report, but suppress the losses and only count the wins in the totals. That might get at least one record for every manager.

Or, you could write a subreport for each manager. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
I tried adding a subreport for the manager with no activity for the period. No wins, no losses, no activity. Is there any way based on that condition, to display a message stating there was no activity?

Thanks
 
Why can't you simply find some field associated with each and every manager and make certain that, even if the manager has no wins for the period, his or her name at least appears as a group header. For example, does each manager have some sort of ID number? Another variation would be to pick any field at all that is associated with each and every manager, put it in the details section, and suppress it. That way, you will guarantee a group header for each manager, even if the field that appears in the details section is invisible (i.e., suppressed).
 
the following formula will print your message:

If IsNull({table.ID})
then "Message"
else ""

The field {table.ID} is any field that will always be filled in when records are returned. The boolean part can be used to control any conditon formula.
Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top