Solved

Crystal reports formating total fields

Posted on 2007-03-20
2
1,219 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 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

18 Experts available now in Live!

Get 1:1 Help Now