Solved

Crystal reports formating total fields

Posted on 2007-03-20
2
1,224 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
2 Comments
 
LVL 100

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 250 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IF THEN Statement not working 3 39
Formula for concatenating multiple fields with "commas" to seperate values 4 42
Pull date to Group header 6 26
Crystal Reports 13 5 45
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…
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…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now