Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to fire a report from C# plugin in MS CRM 2015

Posted on by Microsoft Employee

Hi All,

We are trying to execute a report from Button Click. But because of Security Privileges issues we are unable to open the report from Button. We are trying to impersonate User using Javascript but unable to find any solution as it is MS CRM 2015 version. 

Here are my questions now :

How can we impersonate the User using Javascript in MS CRM 2015

Execute the report from C# plugin instead of Javascript (As we have impersonation option directly in Plugin)

Thanks

*This post is locked for comments

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: How to fire a report from C# plugin in MS CRM 2015

    Wondering what the scenario is? Dynamics is not too friendly when it comes to getting those reports built anywhere other than in the user interface.. Especially if you are planning to go online.. But, then, what I'm wondering about is: if you are planning to let the users see that report anyway, then what is the issue with security you are trying to solve?

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: How to fire a report from C# plugin in MS CRM 2015

    You basically have to generate the report from code and attach it to a note field.

    You can try calling the following code:

    www.codeproject.com/.../call-ssrs-reports-by-using-csharp

    www.c-sharpcorner.com/.../ssrs-report-generation-in-c-sharp1

    You might also try to have the report download to client's machine, but didn't try that with CRM

    As Pawel mentioned, make sure you don't compromise security.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to fire a report from C# plugin in MS CRM 2015

    Can you please let me know how to do it. Or else if you can share few links where I can use it to do it

  • Suggested answer
    tw0sh3ds Profile Picture
    tw0sh3ds 5,600 on at
    RE: How to fire a report from C# plugin in MS CRM 2015

    If impersonation from JS would be possible, it would be really big security issue of Dynamics CRM - every user can run his own JS, so he would be able to act as other users (most preferably system administrator...).

    I don't know your full scenario, but based on the information I can tell that I did this once in CRM 2011 - basically I generated report from plugin and attached it in Note under the entity for which the report was generated (you can then prepare a JS function that will open that file after form reloads)

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans