Skip to main content

Notifications

Dynamics 365 Community / Forums / Finance forum / Run two designs of a r...
Finance forum
Suggested answer

Run two designs of a report on controller based on conditions

Posted on by 38
Hi, 
 
Is it possible to run two report designs on the same controller? 
My condition is that I want to trigger the second design only if a certain condition is met. 
Is it possible? 
  • Waed Ayyad Profile Picture
    Waed Ayyad 3,344 on at
    Run two designs of a report on controller based on conditions
    Hi,

    Is your issue resolved?  If yes, mark the answers that helped you as verified.

    Thanks
    Waed Ayyad
  • Waed Ayyad Profile Picture
    Waed Ayyad 3,344 on at
    Run two designs of a report on controller based on conditions
    Hi,
     
    I'm glad your original question is resolved; can you verify my answer in order to help others in the future? For you second question I'm not sure if you can achieve it.
     
    Thanks,
    Waed Ayyad
  • Daniyal Kashif Profile Picture
    Daniyal Kashif 38 on at
    Run two designs of a report on controller based on conditions
    Hi Waeed, 
     
    This works however I may not have been clearer in the question. 
     
    I require that based on the data, I want to trigger the second design based on the number of records in the temporary table. 
    So for example I have 50 records, and I want to trigger the second design only when the record count is more than 25. 
     
     
     
  • Suggested answer
    Waed Ayyad Profile Picture
    Waed Ayyad 3,344 on at
    Run two designs of a report on controller based on conditions
    Hi,
     
    On Your controller's main method, you can add your code:
    public static void main(Args _args)
    {
        YourReportController controller = YourReportController ::construct();
    
        if(YourCondition)
       {
          controller.parmReportName(ssrsReportStr(YourReportName, Design1));
       }
       else
       {
          controller.parmReportName(ssrsReportStr(YourReportName, Design2));
    
       } 
        controller.startOperation();
    }
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     

Helpful resources

Quick Links

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Blog subscriptions now enabled!

Follow your favorite blogs

TechTalk: How Dataverse and Microsoft Fabric powers ...

Explore the latest advancements in data export and integration within ...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 284,781 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,348 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,146

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans