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
5
Medium Priority
?
578 Views
Last Modified: 2015-04-28
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
Comment
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
  • Learn & ask questions
  • 3
5 Comments
 
LVL 101

Expert Comment

by:mlmcc
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

by:rowfei
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

by:mlmcc
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

by:James0628
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

by:
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
Video by: ITPro.TV
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

704 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