Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Summary on the Report Footer Post Reply Post New Topic
Author Message
argel_joseph
Newbie
Newbie
Avatar

Joined: 26 Apr 2011
Location: Philippines
Online Status: Offline
Posts: 8
Quote argel_joseph Replybullet Topic: Summary on the Report Footer
     Posted: 13 Jul 2011 at 2:51pm
I want to do on my report is to summarize the total on the report footer.

Actually, I know how to do this using the Insert Summary. But the main problem is the records on the details that I want to summarize is from Sub Report.

Is anyone there can help me about this?
argel_joseph
IP IP Logged
Robotacha
Groupie
Groupie
Avatar

Joined: 11 Nov 2009
Location: United Kingdom
Online Status: Offline
Posts: 97
Quote Robotacha Replybullet Posted: 14 Jul 2011 at 12:10am
Im not sure myself, but im guessing, 1 way would be be along the lines of using a shared variable?
 
summarize the total in the subreport, and create a shared variable, and retrieve this data in the main report?
 
not sure, just a suggestion. I needed to do something similar before. I needed to get a summarized figure from the Sub to the Main report, and When I read into shared variables, it solved my problem.
 
was a while ago though, and If I needed to do it again, I would probably just look it up again on a forum.
Regards,

Michael Jones
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 14 Jul 2011 at 1:56am
robotacha, you are correct. in order to use the values from a sub report you need to create a shared variable.

SUB REPORT                                                                   

whileprintingrecords;

SHARED Numbervar  X := x + {field};

 

MAIN                                                                                                          

whileprintingrecords;

SHARED Numbervar  X;

X

 

Shared variables can not be suppressed.

Make the font white and the field very small.

They must be placed below the subreport to retrieve the value.

then you need to take the value from the subreport and calculate using manual running totals
 

MANUAL RUNNING TOTALS

 

RESET

The reset formula is placed in a group header report header to reset the summary to zero for each unique record it groups by.

 

whileprintingrecords;

                                                            Numbervar  X := 0;

 

CALCULATION

The calculation is placed adjacent to the field or formula that is being calculated.

(if there are duplicate values; create a group on the field that is being calculated on. If there are not duplicate records, the detail section is used.

 

whileprintingrecords;

                                                            Numbervar  X := x + {field}; ( or formula)

 

DISPLAY

The display is the sum of what is being calculated. This is placed in a group, page or report footer. (generally placed in the group footer of the group header where the reset is placed.)

whileprintingrecords;

                                                            Numbervar  X;

                                                            X

 

 

sharona
IP IP Logged
argel_joseph
Newbie
Newbie
Avatar

Joined: 26 Apr 2011
Location: Philippines
Online Status: Offline
Posts: 8
Quote argel_joseph Replybullet Posted: 14 Jul 2011 at 7:40pm
Thanks for your help Robotacha and sharona, it works great.
But there's still a problem, when I put the SharedVariable on the detail line on the Main Report it always start by Zero, and also on the detail line again, if the value from the SubReport is NULL, it should be remain NULL on the MainReport, but it's automatically copy the value on the previous line.
argel_joseph
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 19 Jul 2011 at 5:10am

shared variables will retrieve the value from the sub as long as you are using the correct variable names, the shared variable is below the sub report. you many need to add a reset value to the sub report for the shared variable

 whileprintingrecords;                         
shared Numbervar  X := 0;
sharona
IP IP Logged
IdoMillet
Groupie
Groupie


Joined: 26 Oct 2007
Location: United States
Online Status: Offline
Posts: 99
Quote IdoMillet Replybullet Posted: 19 Jul 2011 at 6:11am
Not just below the subreport. The shared variable formula in the main report has to be in a SECTION below the section where the subreport is.
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
www.MilletSoftware.com
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum