Skip to main content

Notifications

Announcements

No record found.

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,758 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,758 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,758 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

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,914 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,549 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans