Share via


Copy reports between Microsoft Dynamics CRM on-premises deployments

 

Applies To: Dynamics CRM 2015

The preferred method to copy a report between organizations or deployments is to include the report and any custom entities the report uses in a solution. If you do this, the entity types are mapped automatically by the system. If you choose to manually copy a report to another Microsoft Dynamics CRM deployment, you must change the entity type codes for custom entities referred to in the report.

In this topic

Fix the type code for a custom entity used in a report

Copy a report between deployments

Fix the type code for a custom entity used in a report

The type code for a custom entity may be different on different Microsoft Dynamics CRM installations. If your report contains references to a custom entity type code, such as when you perform a drill-through to a custom Microsoft Dynamics CRM entity, you must change the type code of the custom entity referred to in your report to the actual type code of the custom entity on the other system you are deploying the report to.

The entity type code for all default (non-custom) entities is pre-defined.

&etc=<entity_type_code>. 

The recommended method to refer to the type code is to define a hidden parameter in the report and set its value to the custom entity type code on the original system. After deployment to another Microsoft Dynamics CRM installation, use a SQL statement to set the parameter's value to the type code of the custom entity on that system.

  1. Obtain the custom entity's type code value. To do this, run the following SQL query on the Microsoft Dynamics CRM organization database. Substitute an appropriate organization_MSCRM name. Locate the type code of your custom entity in the resultset.

    use <organization>_MSCRM select Name,ObjectTypeCode from dbo.Entity order by ObjectTypeCode
    
  2. In the report, create two report parameters: CRM_URL and CRM_OTC. CRM_OTC should be of type string. The default CRM_OTC value should be set to the value obtained in step 1.

  3. On the report item that should be used for a drill-through link, add the following Value code:

    =Parameters!CRM_URL.Value &"?ID={" & Fields!new_custentityid.Value.ToString() & "}&OTC="+Parameters!CRM_OTC.Value
    
  4. Preview and save the report.

  5. Copy the report to the destination server according to the instructions in the following section.

Copy a report between deployments

After you redeploy Microsoft Dynamics CRM from one server to another, custom reports must be individually copied to the redeployed (destination) server.

To redeploy one or more reports

  1. When you copy a report that references a custom entity type code, you should update the definition of the CRM_OTC report parameter to reflect the object type code of the entity in the destination system.

    From the destination Microsoft Dynamics CRM server, open a browser window and navigate to the source system Microsoft Dynamics CRM.

  2. In the Microsoft Dynamics CRM Reports list, select the custom report. On the toolbar, select Edit and then select Actions. In the Actions menu, select Download Report.

  3. Select Save. Specify a file name when you are prompted and save the report to the destination system. A copy of the report now exists on the destination system.

  4. In the browser, navigate to Microsoft Dynamics CRM on the destination system.

  5. In the toolbar located above the Microsoft Dynamics CRM Reports list, select New.

  6. In the Report:New Report dialog box, fill in the source file location. Also, fill in the Details section of the form.

  7. Select Save and Close.

  8. Your report will now be displayed in the Reports list. You may have to select an appropriate category or entity from the drop-down menus above the toolbar to see the report.

    If you do not want to define a default filter, go to step 14.

  9. Select your report in the Reports list.

  10. In the toolbar, point to More Actions, and then select Edit Default Filter from the menu.

  11. In the Report Viewer dialog box, define the default filter criteria that will be used every time the report runs.

  12. Select Save Default Filter.

  13. Select Run Report.

After the report is tested and functions correctly, follow these steps to add the report to context-sensitive lists and forms within Microsoft Dynamics CRM.

To add the report to context-sensitive lists and forms in Microsoft Dynamics CRM

  1. Select the report in the Reports list.

  2. On the Actions toolbar, select Edit.

  3. In the Report dialog box, fill in the Categorization section according to the following descriptions.

    • Categories: Categorizes the report according to its intended purpose. For example, a sales report can be included in context-sensitive lists and forms in the Sales area of Microsoft Dynamics CRM.

    • Related Record Types: Associates the report to specific entities, such as an account or contact. The report can be displayed in context-sensitive lists and forms for those entities.

    • Display In: This setting enables the report to be displayed in context-sensitive forms and lists. You can restrict where the report is displayed by using this setting. If you intend to publish a hidden report, clear the Display In text box.

    • Languages: Associates the report to all or English language only.

  4. Select Save and Close.

 

See Also

Report writing with CRM 2015 for online and on-premises
Publish reports

© 2016 Microsoft Corporation. All rights reserved. Copyright