Here is the setup. I have a crystal XI report that is being used in the BO XI environment. only 2 parameters: Start Date and End Date. About a dozen sub reports take those inputs and produce varied rolling 12 month charts.
The user is tired on having to change the parameter values and reschedule the report each month. They want to calculate the start and end dates at runtime, but still have the ability to specify dates if needed.
I started by adding 2 formulas Start and End.
Start code:
if Year ({?Start Date}) = 1900 then
Date(Year(dateadd( "m",-12,CurrentDate)),Month (dateadd( "m",-12,CurrentDate)),1)
else
{?Start Date}
End Code:
if Year ({?End Date}) = 1900 then
Date(Year(CurrentDate),Month(CurrentDate),1) - 1
else
{?End Date}
Then I defaulted the Main report parameters to 1/1/1900 and repointed the links in the subreports so that the sub report parameters were linked to these formulas instead of the main report parameters.
When I run the report none of the sub reports appears. However if I drill down on one it appears correctly in a new tab. I thought it might be an evaluation time issue so I prefaced both formulas with BeforeReadingRecords;....Still the same behavior.
Any thoughts out there? I did something very similar once in CR10 with no problems.
Thanks in advance!
Shane
The user is tired on having to change the parameter values and reschedule the report each month. They want to calculate the start and end dates at runtime, but still have the ability to specify dates if needed.
I started by adding 2 formulas Start and End.
Start code:
if Year ({?Start Date}) = 1900 then
Date(Year(dateadd( "m",-12,CurrentDate)),Month (dateadd( "m",-12,CurrentDate)),1)
else
{?Start Date}
End Code:
if Year ({?End Date}) = 1900 then
Date(Year(CurrentDate),Month(CurrentDate),1) - 1
else
{?End Date}
Then I defaulted the Main report parameters to 1/1/1900 and repointed the links in the subreports so that the sub report parameters were linked to these formulas instead of the main report parameters.
When I run the report none of the sub reports appears. However if I drill down on one it appears correctly in a new tab. I thought it might be an evaluation time issue so I prefaced both formulas with BeforeReadingRecords;....Still the same behavior.
Any thoughts out there? I did something very similar once in CR10 with no problems.
Thanks in advance!
Shane