Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

subreports not always printing 0's

Status
Not open for further replies.

andie18

MIS
Aug 14, 2001
198
0
0
US
Hello I have a report that give numerical summaries of sales reps activities and pipelines. This reports is accessing a GoldMine SQL backend.

The main report uses the history table and counts things like calls, appts, sales. The subreports (there are 5) that use date parameters that count pending/closed sales and units. I have the main report grouping by formula for region and group2 conthist.userid and the sub reports grouping by either conthist.userid or cal.userid. I have the subreports linking to the main report by userid.

My problem is that the subreports do not print 0's for all of the users. It shows all of their sales but if the value is 0 it does not print "0's" for everyone. I have all of the usual stuff checked - convert NULL to default (made sure that was 0) I even created a formula that said if the value was NULL then totext "0" that didn't do it either. If I run the subreport by itself it reacts in the same exact way (thought it was my linking) some users show 0 some don't.

any thoughts?
 
A null means that it isn't finding anything, hence there isn't anything to display. I'll assume that you're displaying the values in the subreport.

There are a lot of unknowns here, but if you want it to display 0 regardless of the data returned, you might use a shared variable to return values from the subreport to the main report for display purposes.

Main report group header:
whileprintingrecords;
numbervar MyValue:=0

Subreport formula:
whileprintingrecords;
numbervar MyValue:=sum(table.field}

Main Report Group Footer:
whileprintingrecords;
numbervar MyValue

Hope this gets you closer.

For the best results, try posting technical information:

Crystal version
Database used
Example data
Expected output

-k
 
thanks for the reply but if there is data available it will always work properly for all users and if the result is 0, it will print for some users but not all of the users.

crystal 8.5 developer, Goldmine 5.5 SQL backend
 
I am having this same issue. Crystal Reports Advanced developer 9, IBM DB2 backend
I am passing the customer ID from the main report to each of 3 subreports. Each subreport represents service appointments grouped by current status code with conditional running totals counting the appt id's in the group footer. I have arranged the running totals as columns representing yesterday, week-to-date, last 30 days etc. I am suppressing details (although the zero's dont show when detail is showing either). Then I have conditional running totals at the bottom of each column (report footer of the subreport) with reset at never.

2 of my subreports show zero when there is no total in the respective column to display, and one subtotal does not show the zeros.

I have checked everything and cannot locate the cause.

Help!!

Thanks,
 
Try
if isnull(@value) then 0 else @value

Madawc Williams (East Anglia)
 
Where would I place this? The fields that are displayed are sum's of a field and a fomula.

so if my formula is:

if {cal.rectype}[1]="S" and {cal.ref} startswith "Static Guarding" then 1 else 0

and then I do a sum of that formula and place it in the group {cal.userid}, where does your formula get inserted?
 
A formula field ought to be able to pick up a sum. If it won't, then redo the total as a running total.

Madawc Williams (East Anglia)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top