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!

Grandtotal Shows Zero

Status
Not open for further replies.

rhpen

Programmer
Nov 2, 2005
40
US
I'm baffled. Crystal Reports 11. Simple report with no subreports. Layout as follows.

RH
PH
GH1
D
GF1
RF
PF

I have several formula fields across. Each field has the same formula (as follows) except I check for a different "type" and the "resultvar" is named differently for each.

NumberVar ResultVal3;

If {test.TYPE}='X' and {test1.TRANSTYPE}<>'Y' Then
ResultVal3:={test1.DOLAMT}
Else
ResultVal3:=0;
ResultVal3

I have a sum for each field in GF1 and a grand total sum in RF.

Problem is on one field only, the grand total shows 0.00 even though there are amounts that show in the details section. The field in question also shows the correct amounts in the GF2 sums; just nothing in the grand total. I have checked the syntax to death (not that there is much to check when inserting a grand total). I've deleted and remade the grandtotal field several times.

Thanks for any help,
 
Are you by any chance missing a colon in some part of the formula? Anyway, I tested your formula and it worked fine. Note that you don't need to use a variable for this. You could just create a formula:

If {test.TYPE}='X' and
{test1.TRANSTYPE}<>'Y' Then
{test1.DOLAMT}

Then insert summaries on this.

-LB
 
lbass,

I can't imagine there is a problem with the formula since the sums in GF1 show up correctly. It's just the grand total for only this field that doesn't show up and there is no syntax to that; just inserting it. I've also deleted and re-inserted the grand total for this field to no avail.

Color me totally stumped,
 
You have a point. What happens if you eliminate the variable as I suggested?

-LB
 
Hi lbass,

You formula worked as advertised in that I don't need the variable. The numbers show up properly in the sums in GF1, but the grand total still shows 0. This one is a stumper.

Thanks,
 
And you are placing the formula in the detail section, right clicking on it, and choosing insert summary->sum->grand total, right? As long as you aren't using a variable that might have been reset before the report footer, I think it sounds like the report might be corrupt.

-LB
 
Yes. Thanks. I'll try re-creating it from scratch into a new file and see what happens.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top