cancel
Showing results for 
Search instead for 
Did you mean: 

Possible to pass a date range to a subreport?

Former Member
0 Kudos

Hi,

I've created a report with three groups and I suppress the second and third group. The first group displays a summary of the details. If I "hide" the details I have a nice summary looking report which I can then click on to drill down into the details. However, I cannot enable the "hide" functionality because of two reasons: 1. I'm using the crystal java viewer and it has serious limitations when using the hide/drill-down feature; and 2. in order to print I have to click on each group item in order to print - so when I have 20 values in my group I'm going into each group 20 times and printing 20 times.

So, I still want a summary view of all my group summaries at the front of my report. How can I consolidate the group values into a single summary view? I attempted creating a subreport that is the same as the main report however the issue is that the initial parameter used is a date *range". I'd like to pass the date range to the subreport and then I'm sure this would all work. Does crystal support passing a date range to a sub-report? If so, how is this done?

thx!

Mark

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Mark,

Yes, you can pass a date range value to the SUbreport!

Here's how its done:

1) Create a formula in the Main report; call it Start_date:

Minimum({?Date_parameter})

2) Create a second formula in the Main report and call it End_date:

Maximum({?Date_parameter})

3) Insert the sub-report and then Right-click the sub-report > Select Change Subreport links > Move the Start_date and End_date formulas to 'Fields to Link to' area and make sure you uncheck the 'Select data in subreport based on field' option.

4) Edit the sub-report (Right-click > Edit) and insert a Record Selection formula to include the parameters from the Main Report.

Go to Report > Selection Formulas > Record:

{date_field} >= {?Pm-@Start_date} and {date_field} <= {?Pm-@End_date}

Hope this helps!

-Abhilash

Former Member
0 Kudos

Hi Abhilash,

That did the trick! Thanks very much!

Just before I close this off can you tell me why when I run my report I do not see all parameter values? Thankfully, the report presents all parameter values when viewing in the java viewer, however, it won't show me any values later than Dec. 16, 2011. Is there a setting within the CR that is limiting the values I can select?

thx,

Mark

abhilash_kumar
Active Contributor
0 Kudos

Hi Mark,

Yes, Crystal Reports only shows 1000 list of values by default. This is, however, controlled by a registry key and you can increase it like this:

Browse to the location:

HKEY_CURRENT_USER\Software\Business Objects\Suite 12.0\Crystal Reports\DatabaseOptions

Create a new key called 'LOV' here and then on the right-hand side create a new string value called 'MaxRowsetRecords' with a value higher than 1000, perhaps around 10000.

Let me know how this goes!

-Abhilash

Former Member
0 Kudos

Hi Abhilash,

I can't seem to locate this path. Is it in the Crystal Reports 11 directory? Or elsewhere?

Mark

abhilash_kumar
Active Contributor
0 Kudos

Hi Mark,

Oh, if you're using Crystal Reports XI R2(11.5.x.x), the path should be:

HKEY_CURRENT_USER\Software\Business Objects\Suite 11.5\Crystal Reports\DatabaseOptions

-Abhilash

Former Member
0 Kudos

Hi Abhilash,

I cannot seem to locate this file. I will close this question for now. Thanks very much for your help!

Mark

Former Member
0 Kudos

Hi Mark,

to locate above path given can found in registry editor.

to go to registry editor, Start-->Run-->REGEDIT(type in) then follow the path.

Regards,

Ambreen

Answers (0)