cancel
Showing results for 
Search instead for 
Did you mean: 

subreport field as group header in main report

Former Member
0 Kudos

Can you a field in your subreport as a group header in the main report?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I've tried that approach, but it doesn't work b/c I'm using the subreport in the details section. The main report is selecting ID, Name, Exam Dt. The subreport is joined by ID, Exam Type and Exam Dt and is retrieving the Next Exam Date from the subreport. The Next Exam Dt is being posted in the details section. However, the main grouping of the report needs to be the Next Exam Date. Any thoughts?

Former Member
0 Kudos

Hi Nichole,

Can you try creating a fake group by creating a formula :

whilereadingrecords;

True;

-- Insert a group of the formula.

-- Insert the sub report on the group header of the fake

group header.

-- Declare a shared variable and assign the value to the

shared variable.

-- And call the shared variable in the main report.

Hope this helps!!!

Regards,

Vinay

Former Member
0 Kudos

Thank you for your assistance Vinay. However, I received an error when following the steps you've listed.

Step One, created formula NEDt - whilereadingrecords;

True;

Step Two, Insert Group, went to the Options tab and selected Use Formula as Group Name - {@NEDt}....however, I can not save this group b/c crystal returns the following error, The formula results must be a string.

What have I missed? I am trying to use a date field.

Former Member
0 Kudos

Hi Nichole,

Are you trying to insert the date field in the group name option.

If "Yes" then please use totext() so that the group name will be converted from date field to a string field.

Hope this helps.

Answers (1)

Answers (1)

Former Member
0 Kudos

HI Nicole,

Create a formula in sub report and pass the field value to a shared variable. Create a formula on main report with the same shared variable and display the value in group header.

Note : please see that your subreport shoueld be placed before your group header.

Thanks,

Sastry