There are many things that can be handled natively within the Dynamics CRM structure. Every once in a while, you’ll run into something that needs a little help from the outside world. Don’t we all need a little help from time to time?
A good example of this would be adding a logo to a Quote or Sales Order. No good way to do that within the CRM framework itself. However, thanks to the open nature of the Dynamics CRM solution, it’s fairly easy to modify the report outside of CRM, make our changes and then import it back in.
For this example, we’re going to modify the Quote form and add our companies logo. You’ll need to have at least a basic understanding of how CRM works, as well as Visual Studio or Visual Studio Business Intelligence Design Studio (BIDS) and SQL Reporting Services (SSRS).
Overview
Reports in Dynamics CRM are actually SSRS reports, wrapped in a CRM framework that passes report parameters, user authentication and other information over to the report to give it the context in which it should run.
Within SSRS, reports generally are not built directly on the Tables / Fields stored in SQL. Microsoft provides objects called Filtered Views that wrap all of the raw data in the context of the security available to the user running the report as well as the context of where the report is being run, including what records to run the report against. These are all parameters passed by the CRM wrapper that surrounds the SSRS report when presented from within Dynamics CRM.
Exporting Reports
We start by locating the report in the Report Center. To find the report center, click Workplace and then reports.
To export the report, click the Edit Report button, then choose Download Report from the Action Menu. Save the report into a project folder where you’ll be storing the files for this project.
This .RDL is what we’ll be editing in BIDS to make our changes.
Modifying the Report – Fixing the Data Source
Open your BIDS app and create a new report server project. On the right side, right-click the Reports folder and choose Add existing reports. Navigate to the report.rdl file that you downloaded and bring it into the project.
Weird CRM thing here…: When CRM exports the RDL file it normalizes it for editing (code phrase for I don’t know what it’s doing, but it changes some things around). One of the thing that happens on a regular basis is that the datasource that’s embedded in the RDL file gets reset to the default CRM company Adventure_Works_Cycle_MSCRM. You’ll need to reset that.
Click the Data tab and then the […] link to the right of the dataset selector.
Open the dataset and hit the […] again to get to the Connection string. Correct the server name (which will likely have defaulted to localhost) and the catalog (enter the name of your company’s CRM database)
Making Changes
Go ahead and make your changes to the report. Remember if you have to rebuild the SQL query to use the Filtered Views whenever possible. These provide the prefiltering capability to the user and wrap the report in the security context of the user to prevent unintended data visibility.
When you are done making changes, you now need to upload the report to CRM.
Uploading the report
After your changes have been made, you’ll want to upload the report to Dynamics CRM.
Please, please, please: Save that original report file somewhere you can get back to. I’m not saying you might going to screw something up, I'm saying you WILL screw something up someday and it’s a lot easier to republish that original .RDL file than to try and restore it back in.
Edit the report you want to replace and click the Browse button.
There you go, you’ve modified your first Dynamics CRM SSRS report. Don’t you feel like you’ve accomplished something!
A better solution is to create a new report and upload the .RDL file to that, leaving the original one. This gives you something to roll back to in case … um, SQL screwed something up.
Sub-Reports
Note that some of the report (quotes, sales orders, invoices) present their data through sub-reports. These are framed into the main report. The sub-reports would also need to be downloaded and modified. To find these, change the default filter view for the Reports listview to All reports, including sub-reports.
This article is based on an ExpertsExchange tip by member CRM_INFO. The thread is located here -http://www.experts-exchange.com/Microsoft/Applications/Microsoft_Dynamics/Q_24348850.html
No comments:
Post a Comment