Solved

Change heading inside a subreport when the subreport returns now rows.

Posted on 2011-02-14
2
393 Views
Last Modified: 2012-05-11
Hi my background is as a developer in PeopleSoft apps. I am fairly new to Crystal reports (using version 9) since I would normally write an SQR. However, Crystal is a very capable tool andI have an opportunity to use it more - so I want to. So far though I am finding very limited online resource for syntax help etc (happy to receive site or book recommendations!).

Anyway, to my current problem. I have a subreport which uses a formula for a  heading . The formula is based on a simple count of rows - like this.

IF Count(queryname) > 0 Then
"heading text" + Clientnamefromquery
Else
"Alternative heading text"

When there are rows, the formula works. When there are no rows it seems Crystal doesn't even get to the formula, so is there a better way to display the "Alternative heading text"?

Thanks in advance!
0
Comment
Question by:simonpaul64
2 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 34886629
Place each heading in its own textbox.
Use a conditional suppression formula to suppress each one ..

The conditional suppression formula for the 'There is data' heading would be..

IsNull({table.field})

where table.field is any data field that will be displayed if there is data to be printed.

For the 'No data' heading you use a conditonal suppression formula of
Not Isnull({table.field})

You can position one textbox on top of the other to get the heading in the same place each time.

The Conditional suppression formulas are entered in the X+2 button against the Suppress option in the Format Field dialog for each textbox. (and just to emphasise... these are 'when to suppress' formulas, not 'when to display')
0
 
LVL 5

Author Comment

by:simonpaul64
ID: 34886835
Yep - that's exactly what I wanted - and thanks for the emphasis on the suppression side - makes perfect sense.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

827 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question