on 12-22-2007 11:59 PM
In Crystal 11 I have 2 sub reports containing totals.Is there a way to total both of those totals and place in main report?
DZ
You will need to create shared variables from each sub-report and then formulas in the main report to add them.
sub-report 1
create a formula with the following:
whileprintingrecords;
shared numbervar numberone := sum({table.field})
sub-report 2
create a formula with the following:
whileprintingrecords;
shared numbervar numbertwo := sum({table.field})
Main report
sub-report 1
create a formula with the following:
whileprintingrecords;
shared numbervar numberone;
shared numbervar numbertwo;
numberone+numbertwo
This is the bear bones of it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
declare shared variables in the resepective subreports to store the total. once you declare them then create two formulas in main report and assgin those shared variables to those formulas the syntax would be as follows
in subreport 1
First formula would be "initval", here u declare a shared variable and keep in page header, so that it will be initated to 0 each time
initval (syntax is as follows)
shared numbervar tot1 :=0;
second formula is for "total1"
syntax for this formula would be as follows
shared numbervar tot1 := shared numbervar tot1 + table1.amount (this is field which u want the total)
in subreport 2
formula one would be again "initval" here u declare a shared variable and keep in page header, so that it will be initated to 0 each time
initval (syntax is as follows)
shared numbervar tot2 :=0;
Second formula would be for "total2"
syntax for this formula would be as follows
shared numbervar tot2 := shared numbervar tot2 + table1.amount (this is field which u want the total)
now in main report
first formula is " totsub1"
syntax would be as follows
shared numbervar tot1;
second formula is " totsub2"
syntax would be as follows
shared numbervar tot2;
now you create one more formual for tot1+tot2
you will get total from both the sub report.
If u have any queires please get back to me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.