cancel
Showing results for 
Search instead for 
Did you mean: 

Sub Reports

Former Member
0 Kudos

Hi,

I have taken the Subreport. In the main report two groups are there based on ID(first group), timestamp(second group), for my purpose, i have taken subreport in the second group (it returns one value), based on the timestamp sometimes, it gives two values for one id. i want sum of these two values for one Id, i have used shared variables in the subreport, i am getting value back from the crystal report, can you give me any solution for this?

Regards

Pavani

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Pavani,

As I understand from your post that you want to sum up the value if there are two or more values in the sub report and pass it to the main report?

For that use two formulas in the sub report declare a shared variable for example see below:-

1) Place this formula in the report header of the sub report.

(

whileprintingrecords;

shared numbervar total:=0;

)

2) Place this formula in a section where you have placed the database field which you want to add.

(

whileprintingrecords;

shared numbervar total:=total+;

)

3) And Insert a section below the subreport in the main report.

4) And place this formula in the section below the subreport;

(

whileprintingrecords;

shared numbervar total;

)

Please let us know if you have any further queries.

Regards,

Vinay