Skip to Content
Former Member
Nov 05, 2014 at 11:36 PM

shared variable from subreport


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


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

Main report formula


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