Skip to Content

Problem with Data being returned from Subreport to Mainreport

I created a Crystal Report that has in it an embedded subreport. I created a parameter field in the Mainreport that is pointing to an item# field. I then link this parameter to a similar item# field in the subreport. I created a shared variable on both sub and main and put the shared variable into my mainreport. When I put in to the parameter on the main just one item # everything goes perfectly. Once I put in more than one item# this is what happens:

The subreport area of my main, the sub returns both item#s' info just fine, HOWEVER the shared value on my main is only returning the data of the second item and using that same data for the second item (or more items, if I send over more) as well. so my main report seems to not be relating the data correctly that it just got from the sub. Very frustrating.


Would really appreciate help here!

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Feb 05, 2019 at 05:17 PM

    Variables that are shared between the main report and a subreport will only return a single value to the main report - the last value the variable has in the sub report. There is no easy way to push data from multiple records in a subreport up to the main report.

    If you'll explain a little more about what you're trying to return from the subreport, I may be able to come up with a way to accomplish it (no guarantees, though).

    -Dell

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Dell,

      It turns out my mistake was that in the subrep links I was linking the parameter to the field in the subreport, whereas I should've been linking the main report field the parameter in my main report was referring to, in my main report, instead and then it worked. Thanks!

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.