Источник:
http://blogs.msdn.com/b/crm/archive/...dashboard.aspx
==============
Dashboard is one of the powerful and highly demanded features introduced in
Microsoft Dynamics CRM 2011. You can add Charts, Lists, Web Resources, and Iframes to a Dashboard to provide high level analytical view of CRM data. To understand more about Dashboards, start with
this blog post.
Having Web Resources on Dashboard enriches the Dashboard capabilities and take the Dashboard to a whole new level.
One such example is to have a Web Resource to add Reports to a Dashboard.
So let's see how a Web Resource mimics as a Report Control for a Dashboard (and Entity Forms). Here are the screenshots on how it would look on Dashboard:
Install Solution
This is a one time task for System Administrator to create this Web Resource. You can install the solution from
here.
This works for both User and System Dashboards. Also for both user and organization owned reports. This solution installs Web Resource(“msdyn_ReportControl”) and sample System Dashboard showing the custom Report (“My Won Vs. Lost Vs. Open Opportunities”).
Content of the Web Resource is explained in later section.
Add Report using Dashboard Designer
After you install a Solution in the system, you can add reports to a user Dashboard, system Dashboard or an Entity form.
To add Report to a User Dashboard:
- Go to Reports list and right click the Report that you want to add on Dashboard.
- Click on "Copy a link". It would be something like: http:/crmreports/viewer/viewer.aspx?id=%7bD6EF3D47-40D5-DF11-8B26-00155D2A6D04%7d
- Paste the link into a text editing program such as Notepad.
Copy only the last part of the link. For example, you would copy D6EF3D47-40D5-DF11-8B26-00155D2A6D04, from the following link text,
http:/crmreports/viewer/viewer.aspx?id=%7bD6EF3D47-40D5-DF11-8B26-00155D2A6D04%7d
This is the report ID.
- Go to Dashboards, click on New button in ribbon.
Click a template and then click Create.
- Click on Insert Web Resource from one of the placeholder on Dashboard designer canvas.
- In the Add Web Resource dialog box, in the Web Resource box, click the LookUp button and then choose “msdyn_ReportControl”.
- In the "Custom Parameter (data)" box, paste the report id.
If selected, clear the following check boxes:
· Restrict cross-frame scripting
· Pass record object-type code and unique identifier as parameters
Click OK.
7. Resize and place the report control where you want it on the dashboard.
8. Type a name for the Dashboard and click "Save And Close" button.
Web Resource content
Now let's understand the content of the Web Resource.
The Web Resource is of type html and also contains JavaScript. It first reads the report id from the query string parameters and server url using ClientGlobalContext.js.aspx. Then, it creates an Iframe with src set to viewer.aspx and with proper parameters. Additionally, it removes some UI elements from Iframe to give a cleaner look.
Function SetReport creates Iframe. It first gets the report id from query string parameters and server url. Once, having all the info to create src of Iframe, it creates the iframe element and appends it to document.
In function ShowFrame, two controls menubar and editFilter are set to display:none, since they are actually not required when displaying report on Dashboard or form. This gives more cleaner User Interface.
Function qs(search_for) reads query string parameters and returns report id.
Function getServerUrl returns the server and org url.
You can try creating similar type of Web Resource to display the report/data from other(outside of CRM) sources also.
Happy Dashboarding!
Atul Goyal
Источник:
http://blogs.msdn.com/b/crm/archive/...dashboard.aspx