web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to grant permission to SSRS Report?

(0) ShareShare
ReportReport
Posted on by

Hi,

I was assigned to create a customized report in Dynamics AX runs on Shipment Details Form. I have created a SSRS report and Deployed it to Dynamics successfully.

And I have added a new MenuItemButton under the existing Print Button Group in the Shipment Details Form and override the Clicked event to call the SSRS report directly.

330210.Capture.JPG

(I did not create a Menu or MenuItem) 

Here is my code below...

SrsReportRun srsReportRun;

str 30 ShipmentID_ ;;
ShipmentID_ = WHSShipmentTable_ShipmentId.valueStr();

srsReportRun = new SrsReportRun("CMR_ReportFromShipment.CMR_FormReport");

srsReportRun.init();
//Passing the Parameters through X++

srsReportRun.reportParameter("CMR_ReportFromShipment_ShipmentId").value(ShipmentID_);

srsReportRun.showDialog(false);

if( srsReportRun )
{
srsReportRun.executeReport();
}

As I have the System Administrator access to the system, so that I can run the report without any issue. 

But when a user click on the same MenuItemButton , it does not run the report and there is no error message either.

I have googled and referred lot of articles related to Dynamics Security Controls , but still I could not solve the issue.

Can someone please help me with this?

Thank you in Advance.

Regards,

Tharindu. 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Khurshid Wali Profile Picture
    928 on at

    HelloTharindu,

    I would say as best practice use menu items so you can simply add that menu item to "privilege Entry Points" you can pass the parameter through menu item too.

    For your implementation, did you try to add your control to privilege?

    screenshot for help.

    10682.3.JPG

    regards,

    Khurshid wali  

  • Suggested answer
    Khurshid Wali Profile Picture
    928 on at

    One more thing did your user have access to report server?

    if not try this.

    Grant User access to Report server

  • Community Member Profile Picture
    on at

    Thank you for the reply Khurshid.

    When I use a MenuItem and adding a Privilege Entry Point.

    I have changed the the code as below.

    void clicked()
    {

     new MenuFunction(menuItemOutputStr(AMS_CMRFromReportFromShipment), MenuItemType::Output).run();

    }

    Then it will open a parameter screen and ask for the Parameter(ShipmentId).

    Is there a way to pass the parameter directly to the report, without popping up the parameter screen?

    I have not create any controller classes to this.

    And the other way I tried calling the MenuItem directly from the MenuItemButton as below without overriding the Clicked method .

    2021.Capture1.JPG

    But ShipmentID did not passed to the parameter screen. 

    Any help is much appreciated.

    Thank you.

  • Suggested answer
    nmaenpaa Profile Picture
    101,162 Moderator on at

    I suggest you simply change your button to a menu item button, instead of using a dummy button and a clicked method.

    With menu item button the system will automatically show/hide the button based on the privileges of the user.

    To pass data from your form to the report, you need to specify the "Data source" property of your button (or button group where the button is). Then the system will automatically send the selected record(s) from the data source to the menu item.

    If you simply type "ShimentId" in the Parameters, it will pass string "ShipmentId" as a parameter but I don't think your report has any handling for it. Or does it?

  • Community Member Profile Picture
    on at

    Hi Nikolaos,

    I have used a MenuItem Button for this, and user can see the button as well. When the user clicks on the button nothing happens, and a users who are under the System Admin Role only can open the report. When I typed "ShipmentId" in the parameter section, it passes the string not the ShipmentId.

    Thank you.

  • Suggested answer
    nmaenpaa Profile Picture
    101,162 Moderator on at

    Yes, if you type "ShipmentId" in the parameters, the parameters will contain "ShipmentId". If you type "Foo" the parameters will contain "Foo". If you want to pass some parameters to the query, you can find a lot of articles and discussions by a web search - here's one: community.dynamics.com/.../169586

    About the menu item button "not working", it must be because of the settings that you have on that button. When you run your menu item from code, you don't set any properties or args for the menu item. And when you run it from the menu item button, there are some properties and args. Something there is not yet fully working with your security settings.

  • Suggested answer
    Khurshid Wali Profile Picture
    928 on at

    [quote][/quote]

    Thank you for the reply Khurshid.

    When I use a MenuItem and adding a Privilege Entry Point.

    I have changed the the code as below.

    void clicked()
    {

     new MenuFunction(menuItemOutputStr(AMS_CMRFromReportFromShipment), MenuItemType::Output).run();

    }

    Then it will open a parameter screen and ask for the Parameter(ShipmentId).

    Is there a way to pass the parameter directly to the report, without popping up the parameter screen?

    I have not create any controller classes to this.

    And the other way I tried calling the MenuItem directly from the MenuItemButton as below without overriding the Clicked method .

    2021.Capture1.JPG

    But ShipmentID did not passed to the parameter screen. 

    Any help is much appreciated.

    Thank you.

    Try setting NeedsRecord to "Yes"

  • Community Member Profile Picture
    on at

    Khurshid,

    Nothing has happened by changing the NeedsRecord to "Yes"

    But I was able to sort the issue. Thanks everyone for your help.

    Regards,

    Tharindu.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans