1
votes

I have an existing report that works like this:

Main Report SubReport 1 SubReport 2

There is a field in SubReport 1 which needs to be a concatenated string from some related record. If I could create a subreport within a subreport, I would be done by now. But since that's not possible, my thought was to create another (non-printing) subreport in Main which loops through the records I need, and concat's the values I want into a shared variable. Then I display that shared variable in SubReport 1.

Well, I've tried a number of things, and I have a lot of problems, but first off, I can't even get the string to populate correctly. The formula in my subreport only get the first value.

Here's my formula:

WhilePrintingRecords;
shared stringvar PressMats;
PressMats := PressMats + {PV_JobStep.ItemCode} + "    ";

For the test report I'm running, there are two records in table PV_JobStep that should be picked up. It only picks up the first one. The formula is placed in the Report Header of the SubReport. That's the only place where it will run, even though it seems to me to make sense that it should be in the Details section of the SubReport, but then I get nothing.

Please let me know what other details I can provide. I'm new to Crystal Reports.

1

1 Answers

0
votes

Create another formula for reseting variable and place it in footer. WhilePrintingRecords; shared stringvar PressMats='';