Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Crystal reports formating total fields

Posted on 2007-03-20
2
Medium Priority
?
1,233 Views
Last Modified: 2008-01-09
Crystal reports 11.00

I have written a report that has a number of sub-reports that print totals. The problem we are having is as follows :-

If there are no records in the sub-report we would like the total fields to print '0' at present they are returning a 'blank' where there are no records selected. Any ideas?
0
Comment
Question by:Jonathan_Heller
[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 101

Expert Comment

by:mlmcc
ID: 18756358
Where are you printing the totals?
  In the subreport or the main report?

How are you calculating the totals?

mlmcc
0
 
LVL 1

Accepted Solution

by:
Headmasters earned 750 total points
ID: 18760142
Sounds like your producing the totals in the main report using a Shared variable. When declaring the shared variable in the main report you could always declare it as 0 + itself.

e.g.
(In Subreport)
Shared NumberVar SubreportTotal
SubreportTotal:=Sum({Table.field})

(In Main Report in section after subreport)
Shared NumberVar SubreportTotal
SubreportTotal:=0+SubreportTotal;

In theory then if the subreport is blankl then subreportotal in the main report will still =0;

The other alternative would be to use a statement "if isnull subreportotal then 0 else subreportotal"

Please ignore syntax in the above.

I hope this helps, I haven't tested it myself so not to sure
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

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 will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
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

604 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