Solved

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

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

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 …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

770 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