cancel
Showing results for 
Search instead for 
Did you mean: 

Refreshing subreport data on change of group in the main report

Former Member
0 Kudos

I have created three comma delimited strings in a subreports and then introduced them to the main report. The subreports are simple with no groups. I have one subreport for Authors, one for Departments and one for Schools. This is ok if I filter the data down to one publication. If I remove the filter then I get every instance of each of the subreports. ie all authors in a comma delimited string, all departments and all schools.

I have two groups in the main report, Publication Year (Group #1) and Publication Title (Group #2). This is where I have the problem. The data coming from the subreports show all instances as mentioned above. I want the subreports data to refresh each time the group changes. I need it to only show the necessary comma delimited string for each publication, not every instance.

Accepted Solutions (0)

Answers (1)

Answers (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Brian,

That would require you to place the Subreport (that returns the comma delimited string) on the Group Header/Group Footer and link the Subreport with the Publication Year/Title field.

To link the Main Report to the Subreport, right-click the Subreport > Change Subreport Links > Move the Year and Title fields to the pane on the right > From the dropdown for 'Select data in Subreport based on field', choose the right fields for year and title from its source.

If linked properly, each Subreport should show values belonging to that group alone.

-Abhilash

Former Member
0 Kudos

Hi Abhilash,

The logic has worked correctly but the performance is really poor. Is this because I have there subreports doing similar funcitons? Is this a topic for another discussion?

Also, when I try to export the report to xls data only it starts the export but then a msg comes up on the screen relating to the second formula you gave me for comma delimited strings for schools:

SAP Crystal Reports

String length is less than 0 or not an integer.

This relates to the third line in the code:

Left(schools, len(schools)-2);

It then aborts the export. Is this a topic for another discussion also?

Thanks