I found the answer to my question:
Let's say that the dynamic parameter, MyParameter, based on a view, MyView, with two fields: MyViewValue and MyViewDesc.
1. Add the fields MyViewValue and MyViewDesc to the Details section of the main report which should be in the same section as the subreport.
This will give us the data that we are going to want to show on the subreport. However, we don't want it to show on this report, so we have to hide those fields.
2. In the Format Editor of each of the two fields we just added check the box to enable the Common property Suppress.
This will hide those fields from displaying on the main page. Now we need to collect all those values together.
3. Create a new formula, MyFormula, with the following code in it:
WhilePrintingRecords;
StringVar MyParaList := MyParaList + ", " + Trim(CStr({MyView.MyViewValue})) + " - " + {MyView.MyViewDesc};
If OnLastRecord Then MyParaList := Mid(MyParaList,2);
That will build a list of the MyViewValue and MyViewDesc for each record in the list. We need to limit the list to what we've chosen as a parameters.
4. In Select Expert set MyViewValue to be equal to MyParameter.
That will limit the occurrences of MyViewValue and MyViewDesc to only what we've selected, but this will cause a report for each of those values to be generated all appended end-to-end. We need to only show one copy of the report, not multiple copies. We need to suppress some copies of the report.
5. Go to Section Expert and choose the Details Section and set the Suppress formula to:
Not OnLastRecord
That will suppress all but the last copy of the report from displaying. Now we need to get this new formula over to the subreport. The is done in the traditional way.
6. Edit the Subreport Links to link the MyFormula field.
Once you have the value in the subreport you can do with it as you please. I usually put it in the header with some nice formatting.
It is a shame that Crystal Reports makes this so hard to do. One would think this would be a common operation. If anyone has any suggestions for improving this please feel free to post them here.
Edited by cjbarth - 24 Sep 2010 at 1:35pm