cancel
Showing results for 
Search instead for 
Did you mean: 

shared variable from subreport

Former Member
0 Kudos

I have created a shared variable that is returning a date from a subreport to my main report. I have placed the sharedvar field in group b. My subreport is in group a. This is working fine.

The reason for returning the date from the subreport is so I can use it calculate the number of days difference between a date on my main report. When the shared variable returns a date the report correctly tells me the number of days between the 2 dates, however when the shared var returns null or nothing the report uses a date from the previous group. Is there any way I can stop this from happening?

Here are the formula's I am using

on the subreport

whileprintingrecords;

shared datevar firstassessmentdate := minimum({assessment.assessment_date})

Main report formula

whileprintingrecords;

shared datevar firstassetdate;

this is placed in group B

datediff formula on main report

datediff ("d",{client.Start_Date},{firstassessmentdate}) this is also placed in group B

Many thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

ido_millet
Active Contributor
0 Kudos

Use a main report formula in the same section of the subreport or in a section ABOVE it to RESET the shared variable.