Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Crystal Reports - Change sub-report blank value

Posted on 2015-02-05
Medium Priority
578 Views
Hi,

I have several sub-reports that group by the one category. In the main report links to two different sub-reports, which displays "Item 1" & "Item 2" for each category. Since Item 1 doesn't have record under category A, but item 2 does. That's why the reports shows below:

Category                                    Item 1            Item 1 %        Item 2            Item 2 %
A                                                       /                                        12/15               82%
B                                                   20/25                85%            15/18               90%
C                                                       /                                         25/30              88%

Total:                     20/25                   85%          52/53                89%

How can I change those no record item 1 under category to test "N/A".. Below is the report that I would it to be displayed:

Category                                    Item 1            Item 1 %        Item 2            Item 2 %
A                                                   N/A                                        12/15               82%
B                                                   20/25                85%            15/18               90%
C                                                    N/A                                         25/30              88%

Total:                     20/25                   85%          52/53                89%

Thanks,
0
Question by:rowfei
[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
• 3

LVL 101

Expert Comment

ID: 40592965
What are you using to display the data now?

Is it a formula?

If so can you change it so if there is no data it will show N/A

mlmcc
0

Author Comment

ID: 40593561
Hi mlmcc,

I have two formulas below. Then I add a text into the report: total_Y/total.

total_Y := sum({@total_Y});
total := sum{@total});

Thanks,
0

LVL 101

Expert Comment

ID: 40593747
How do you show the 20/25

Is it like

CStr(total_Y,0) & '/' & CStr(total,0)

If so try this

If CStr(total_Y,0) & '/' & CStr(total,0) = '/' then
'N/A'
Else
CStr(total_Y,0) & '/' & CStr(total,0)

mlmcc
0

LVL 35

Assisted Solution

James0628 earned 1000 total points
ID: 40595515
mlmcc,

I think when he said "I add a text", he was talking about creating a text field (containing the "/"), and then dropping the formulas into the text field.

I have no idea what you get when you use CStr on what I guess is basically a null Sum, because there were no records.  FWIW, based on what he posted, I see no need for the variables.  I'd try using CStr on the formula sums (eg. CStr (Sum ({@total_Y}), 0) and CStr (Sum ({@total}), 0) ).

rowfei,

Another option might be to use IsNull.  If the sums are actually null, that might work.  CR will let you use IsNull on a Sum.  I just don't know if that will actually catch the values that you need it to.  The formula would be something like this:

if IsNull (Sum ({@total_Y})) then
"N/A"
else
CStr (Sum ({@total_Y}), "#") + " / " + CStr (Sum ({@total}), "#")

I only tested one Sum for a null, because presumably if either Sum is null, the other will be too, so there's no need to check both of them.

James
0

LVL 101

Accepted Solution

mlmcc earned 1000 total points
ID: 40595843
You are probably right about how he does it.  In that case he could just drop the formula into the text box or use similar formulas for the two he drops in now.

mlmcc
0

## Featured Post

Question has a verified solution.

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

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 …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
###### Suggested Courses
Course of the Month6 days, 16 hours left to enroll