Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Open SSRS Report From CRM Button Click

Posted on by 2,622

Hello guys,

I have developed few SSRS Report. i want to open that SSRS report based on the user select the record from grid and click the button. i am able to select records but not able to open SSRS Reports. i tried different solution provided by many users over different blogs but no solution. Kindly share your views on this.

*This post is locked for comments

  • Verified answer
    Vikas Gupta Profile Picture
    Vikas Gupta 2,622 on at
    RE: Open SSRS Report From CRM Button Click

    Hello Guys,

    I found the solution, instead of uploading the Report in CRM and call it from C#. i call  SSRS report directly using below code.

    var acsw_report_link = "http://<Servername>/ReportServer/Pages/ReportViewer.aspx?<ReportName>;

    window.open(acsw_report_link);

  • Suggested answer
    Friyank Profile Picture
    Friyank 944 on at
    RE: Open SSRS Report From CRM Button Click

    I have my blog Here Which pass parameter to SSRS report. 
    You can attach link to button or any URL text input on form. 
    Make sure In your URL 
    https://orgName.crm.dynamics.com/crmreports/viewer/viewer.aspx?action=filter&helpID=Account%20Overview.rdl&id=%7b2B2A692E-7D04-E711-80E6-00155DB8652A%7d&p:SourceStatus=Value

    Action is set to Run and not filter. 

    Hope it helps 

  • Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: Open SSRS Report From CRM Button Click

    Vikas,

    You need to maintain a kind of logical mapping somewhere and based on that you can run report, Agree with Preeti you can add a custom entity where you can have reports and it's details, or you can also have xml webresource where you can maintain this mapping and based on your record identification logic (on which type of record you want to open which record) you can fetch report and open report.

    Hope it will help you.

  • Suggested answer
    Preeti Sharma Profile Picture
    Preeti Sharma 2,678 on at
    RE: Open SSRS Report From CRM Button Click

    Hi Vikas,

    You can use a web resource that will be triggered on click of button.

    Additionally you can create a "Report Configuration"  entity (i.e. custom entity). Add field in entity to select record and then pass GUID of record to query string to run report.

    To open report you can use below javascript code:

     function callReport(){

      var rdlName;

               var reportGuid;

               var entityName = Xrm.Page.data.entity.getEntityName();

               rdlName = "Activity_Call_In.rdl";

               reportGuid = "DAC4913-5E4E-E611-80FC-3863BB34FC88";

               var reporturl = Xrm.Page.context.getClientUrl() + "/crmreports/viewer/viewer.aspx?action=run&helpID=" + rdlName + "&id=%7b0" + reportGuid + "%7d";

               var newtab = window.open();

               newtab.location = reporturl;

    }

    For more information please go through following links:

    community.dynamics.com/.../running-a-report-from-a-ribbon-button

    community.dynamics.com/.../know-how-dynamics-365-ssrs-pass-prefiltering-report-parameter-and-open-report-using-url-javascript

    Hope this helps !:)

  • Vikas Gupta Profile Picture
    Vikas Gupta 2,622 on at
    RE: Open SSRS Report From CRM Button Click

    Hello, Actually my scenario is bit twisted. I have 8 reports and want to print 1 report based on Record selection. I am able to select the record and can get the record GUID. Now Based on GUID i want to Print the 1 of the 8 report, This is where i am stuck.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Open SSRS Report From CRM Button Click

    Hello.  I don't know how to do it in C#.  I build all my reports in Visual Studio and upload the rdl file to CRM using the customizations interface.  The report is then available on using the Report Button on the Entity Ribbon bar, which then allows to run on selected record or all records.  Using the customization makes it really simply.  Go to reports > New >   Where it says Report Type select Existing file.  Then browse to your rdl file that you created in Visual Studio, Upload, and then fill out the rest of the form.  

    Good luck.  Let me know if you choose this path and need help. 

  • Vikas Gupta Profile Picture
    Vikas Gupta 2,622 on at
    RE: Open SSRS Report From CRM Button Click

    Hello MajorPatrick,

    No, Reports are still under the URL http://<server>/ReportServer, But i can add report in CRM Customization interface. Only thing that i am not able to find that, Open the report from Plugin(C#) on button Click.

    i used below code.

                           using (ReportExecutionServiceSoapClient client = new PaymentDue.ReportExecution2005.ReportExecutionServiceSoapClient())

                           {

                               client.ClientCredentials.Windows.ClientCredential.UserName = "<Username>";

                               client.ClientCredentials.Windows.ClientCredential.Password = "<Password>";

                               client.ClientCredentials.Windows.ClientCredential.Domain = "<Domain>";

                               client.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;

                               ServerInfoHeader serviceinfo = new ServerInfoHeader();

                               ExecutionInfo info = new ExecutionInfo();

                               client.LoadReport(new PaymentDue.ReportExecution2005.TrustedUserHeader() { UserName = client.ClientCredentials.Windows.ClientCredential.UserName }, "Sales contract Collection letter 1", null, out serviceinfo, out info);

                           }

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Open SSRS Report From CRM Button Click

    Have you added the report through the customizations interface so that the report is available to the user the report button on the ribbon bar for whichever entity you are using?

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans