?
Solved

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

Posted on 2011-02-14
2
Medium Priority
?
397 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 2000 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month12 days, 13 hours left to enroll

777 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