Solved

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

Posted on 2011-02-14
2
382 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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 …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now