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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Special sum in CrystalReport 1

Status
Not open for further replies.

Asia001

Programmer
Jan 19, 2005
16
PL
Hi,
I have problem. I created Runing Total Field sum value. I have data
first page, second page
1 4
2 1
3 2
//RuningTotalField for pages have value
------- -------
6 13
but I want to this value add number 4. So I want
------- -------
10 17
Can You help me?
 
Do a formula field that adds 4 to the running total

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
You could do a manual running total, where you create an initialization formula to be placed in the report header:

whileprintingrecords;
numbervar rt := 4;

Then in the detail section, place:

whileprintingrecords;
numbervar rt := rt + 1;

To display results at the page footer level, use:

whileprintingrecords;
numbervar rt;

-LB
 
I have only one problem. Sometime in first row on first page formula return value 6. I don't know why. I give some different formula to report. Can different formula change this value? I use different numbervar.
 
If you use the same variable in a different formula that is accumulating, it would change the value. But since you say you are using a different variable, I'm guessing that you have some suppressed records that are being counted. If you are conditionally suppressing records, then you need to build the suppression criteria into the accumulation formula, as in:

whileprintingrecords;
numbervar rt;
if {table.field} <> "x" then
rt := rt + 1;

-LB
 
I find this property: I have

reportheader -
whileprintingrecords;
numbervar rt := 4;

pageheader -
whileprintingrecords;
numbervar pierwszy;

details -
whileprintingrecords;
numbervar rt := rt + {@WartSprzedTowUslug};
numbervar pierwszy := pierwszy + {@WartSprzedTowUslug};

pagefooter -
whileprintingrecords;
numbervar pierwszy;

whileprintingrecords;
numbervar rt;

this is my code, but I want to pierwszy return sum from page so I write
pageheader -
whileprintingrecords;
numbervar pierwszy := 0;
than I have this effect (first value is add twice).

What do You think about this?


 
What is the content of {@WartSprzedTowUslug}?

-LB
 
I can't see why this should occur. Do you have any groups with repeating group headers? If so, you shouldn't have any of the variable formulas in the group header.

-LB
 
Oh Yes! Thank You very much. I don't know why, but when I remove all groups from my report is good. I didn't haved variable in this group. Important that is good.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top