|
-
Jul 27th, 2010, 10:23 AM
#1
Thread Starter
Fanatic Member
Subtotal Per Page (Crystal Report)
How to print a subtotal base on per page, lets say i have 3 pages in crystal report there should be a subtotal per page. How to do that ?
-
Jul 27th, 2010, 10:54 AM
#2
Re: Subtotal Per Page (Crystal Report)
-
Jul 27th, 2010, 06:52 PM
#3
Re: Subtotal Per Page (Crystal Report)
You need to use three formulas
Formula 1 : @Reset
Code:
NumberVar x;
WhilePrintingRecords;
x:=0;
Formula 2 : @Sum
Code:
NumberVar x;
WhilePrintingRecords;
x:=x+{DatabaseField};
Formula 3 : @Display
Code:
NumberVar x;
WhilePrintingRecords;
x
Place Formula1 in Page Header section and suppress
Place Formula2 in Details section and suppress
Place Formula3 in Page Footer and don't suppress, this is your subtotal
JG
-
Jul 27th, 2010, 10:42 PM
#4
Hyperactive Member
Re: Subtotal Per Page (Crystal Report)
Shouldn't that NumberVar be declared as Shared? Or is that the default in more current versions of Crystal? I thought local was the default so I have always explicitly declared when I need it shared.
-
Jul 28th, 2010, 12:08 AM
#5
Re: Subtotal Per Page (Crystal Report)
Default is 'Global'
A 'Shared' variable should be used when you need to pass (share) a value from the main report to a subreport or from a subreport to the main report
In this case I think that a 'Global' or a 'Local' variable will do the job because is in the same main report
JG
-
Jul 28th, 2010, 09:09 PM
#6
Hyperactive Member
Re: Subtotal Per Page (Crystal Report)
Wow, learn something every day. Been working with Crystal over a decade and I guess I have never used the same variable name twice for different purposes. I'll watch that in the future. Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|