Crystal Report list parameters in main header that is fed into sub report

fhcdaver
fhcdaver used Ask the Experts™
on
I have a sub report that user feeds in region, skills and certifications.  Skills and Certification parameter are set to multi value  to a sub report.  Main report uses two views that join to the skills and certification multi value  parameters.  Those two parameter values are numeric ID but it has description names.  I'm trying to set up a global variable that is created in sub report that captures the skills the user selected and / or certification user has selected and in the main report have those selections outputted to the top of the main report.  Any assistance would be appreciated.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
If I understand what you want to do, you would have to put the subreport into the report header.

Subreports are run v ery late in the report creation process so the only way to get the subreport results into another section is if the section appears after the subreport.

mlmcc
fhcdaverpresident

Author

Commented:
After discussion with Business Analyst, it's ok to have skills listed at the bottom of report.  After some research, I need to create a global variable and then another formula variable that captures unique skills the user has selected and then create another variable that outputs the latest variable.  I believe there is an afterevaluate function.
fhcdaverpresident

Author

Commented:
I mention the afterevaluate because it's ok to have results after the sub report.  My Question is still open.
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
AfterEvaluate is only for functions in the same report.  It is used to control the order of formula evaluation in case one formula depends on another.

If it is ok to have the display in the report footer, you can use SHARED variables to collect the data in the subreport and share it with the main.

Typical method

In the main report Report Header add aformula

WhilePrintingRecords;
Shared StringVar Names;
''

Open in new window


In the subreport - generally the detail section but could be anywhere
WhilePrintingRecords;
Shared StringVar Names;
Names := Names + chr(13) + {STudentNameField};

Open in new window


IN the main report Report Footer to display the value
WhilePrintingRecords;
Shared StringVar Names;
Names

Open in new window


mlmcc
fhcdaverpresident

Author

Commented:
I tried your suggestion and no values came back on report.   I created three formulas and 1st on main report with your code and then I went to sub report and created another formula and placed it in details which is suppressed and then back to main report and created third formula to place it in page footer on main report.
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
Try unsuppressing the sub detail section.  Suppressing a section sometimes causes the formula to not evaluate

mlmcc
Make sure the format for the formula in the page footer (the one that's supposed to output the values) has the "Can Grow" option checked.  mlmcc's second formula would put a Carriage Return ( Chr (13) ) in front of the first value, meaning that the string will start with a blank line.  If you don't have "Can Grow" checked, the field will appear to be blank.

 You might want to change the last line in the second formula to:

Names := Names + {STudentNameField} + chr(13)

 That just puts the CR after each value from the field, instead of in front of it.

 James
president
Commented:
I originally had the values appear by having a formula below that loops through muli parameters from sub report to main report, but I was getting subscript must be between 1 and size of array error.  I've taken a the SQL approach as this is a time sensitive task.  I placed input parameters to be captured in a SQL parameter and then output in the reporting table and then place string value onto report.  I'm all set.
code.txt
fhcdaverpresident

Author

Commented:
Thanks again guys.  It looks like your solutions would have worked too..  We ended up using the SQL stored procedure to do the heavy lifting and have it return the values we need as a single, simpler variable.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial