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 5,341 Super User 2024 Season 2 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 5,341 Super User 2024 Season 2 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 5,341 Super User 2024 Season 2 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
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,451 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,353 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans