How to pass a parameter from main report to subreport in crystal reports

Posted on 2011-10-25
Last Modified: 2012-06-27
I have a main report that takes an orderID to display order item details.

Within this report I have inserted a sub-report that displays details based on an specific line item based on orderID and Line_Number

Sub report works fine by itself, but what I am trying to learn is how to get the 2 variables needed from the main report and pass them to the sub-report. Currently main Packing List report uses orderID as the keyword. The sub-report "PackingList Line Item Detail" would use orderID, and Line_Number to display its information.

PLease any help on this would be appreciated it.

If I need to provide more details, or a copy of the report, I can do that.

Thank you.

Question by:metropia
    LVL 100

    Accepted Solution

    You can link the suubreport to the main report using the parameters.

    Right click the subreport
    Select the OrderId parameter from the main report
    If there is an orderid parameter in the subreport choose it (not the ?pm-OrderId Crystal adds)
    Same for the LineNumber


    Author Comment

    do i need to create selection formulas at all?

    Author Comment

    i have to parameters on main report OrderID and Line_No
    and the same 2 parameters on subreport OrderID and Line_No

    I followed your instructions, and when i refresh the report, it breaks. The report tries to load all records, not the records for the parameteres entered.
    LVL 100

    Expert Comment

    If you link on the subreport parameters then you will have to create the selection formula


    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now