?
Solved

Crystal reports formating total fields

Posted on 2007-03-20
2
Medium Priority
?
1,232 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:
hmuser 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

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 Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month13 days, 4 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