Quantcast
Channel: SCN : Unanswered Discussions - SAP Crystal Reports
Viewing all articles
Browse latest Browse all 4814

shared variable from subreport

$
0
0

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


Viewing all articles
Browse latest Browse all 4814

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>