How to change the sub-report links dynamically in crystal reports 10.x?

Posted on 2007-10-18
Last Modified: 2013-11-26
I  have a main report called "Main.rpt". There are 3 more reports named as "One.rpt", "Two.rpt" and "Three.rpt" separately.

I want to have a sub-report in the "Main.rpt" page which initially points to "One.rpt" file. And at runtime, i need to change the sub-report's pointing link to "Two.rpt" or "Three.rpt".

How can I accomplish this?
Question by:Yogeshup
    LVL 100

    Accepted Solution

    I think the easiest way to do this is to insert all the subreports into the main report each in its own section then suppress the 2 you don't want with conditional suppression.

    You can add "new" sections by
    Right click the left margin of the section you want another
    Click INSERT SECTION below

    If you do that on the details section you will now have
       Detail A
       Detail B

    LVL 100

    Expert Comment

    How do you determine which subreport to use

    You can conditionally suppress a section by
    Right click the left margin of the section you want to suppress
    Click the formula button to the right of SUPPRESS
    Enter a formula that returns TRUE when you want the section suppress

    LVL 42

    Expert Comment

    I agree.

    I don't think you can change it at runtime because you must authenticate to the db before you can make changes but if you change the subreport then you haven't authenticated with the correct info - it's an endless cycle.

    mlmcc's suggestion to include all 3 and suppress the unneeded ones is the best approach.

    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Suggested Solutions

    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    779 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

    11 Experts available now in Live!

    Get 1:1 Help Now