Display SSRS Report in CRM Dashboard with Paging and Hyperlink


  1. Open Visual Studio create a report project and add new report
  2. Go to Data Source provide Embedded  Connection Type : and Credentials as below(If it is online CRM connection type can be different).
  3. Create a Query and add it in Data Set
  4. Create a table and add columns to the table as below
  5. Watch this video  help to create paging in report
  6. https://www.youtube.com/watch?v=gvGvfKxy1r0
  7. Right click on the report column "Company Name" select properties -> Select Action -> Go to Report
  8. Click on expression button and Add this Expression " =First(Fields!orgUrl.Value, "GetOrgUrl")+"/CRMReports/viewer/drillopen.aspx?ID={" & CType(Fields!companyId.Value, GUID).ToString &"}&LogicalName=account" "(In this expression i created one more Data Set to get organisation URL from configuration Record).
  9. Add Report in CRM
  10. Create a html Webresouce in CRM 
  11. <html>
  12. <head>
  13.     <meta>
  14.     <style type="text/css">
  15.         P {
  16.             margin: 0;
  17.         }
  18.     </style>
  19.     <script src="ClientGlobalContext.js.aspx" type="text/javascript"></script>
  20.     <script type="text/javascript">   
  21.         function SetFrame() {
  22.             var clientUrl = Xrm.Page.context.getClientUrl(), iframe = document.getElementById("iframe_id"), url;
  23.             if (iframe != null && iframe != undefined && clientUrl != null && clientUrl != undefined)
  24.             {
  25.                 iframe.src = clientUrl + '/crmreports/viewer/viewer.aspx?action=run&helpID=testReport.rdl&id=%7b6762B8A6-A3B1-E811-8433-005056AFB501%7d';
  26.             }
  27.         }

  28.     </script>
  29. </head>
  30. <body style="word-wrap: break-word;" onload="SetFrame();">
  31.     <iframe src="about:blank" height="400" width="480" id="iframe_id"></iframe>
  32. </body>
  33. </html>


  34. Open the dashboard add HTML web resource.


  35. Click on Company Name(Karvy Data Management) link it will open Account record.


Comments

Popular posts from this blog