Solved

Crystal reports formating total fields

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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

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…
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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

707 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