Numeric values from CRM reports are replaced by "#value!" in the exported Excel file
This article provides resolutions to solve the issue that numeric values from Microsoft Dynamics CRM reports are replaced by #value! in the exported Excel file.
Applies to: Microsoft Dynamics CRM
Original KB number: 3087887
Symptoms
The numeric values are shown properly when a report is generated from a Microsoft Dynamics CRM Online organization, but when the report is exported to Excel in CSV format the numeric values are replaced by #value! in the exported file.
Cause
The code that is generated by the Microsoft Dynamics CRM Online Organization is not recognized by Excel.
Resolution
There are two ways to fix this issue.
Option 1 - Modify the .RDL file by SQL Server Report Builder tool
To fix this issue, we need a .RDL
file of the report that is exported, here's the method to get the .RDL
file of the report.
- Select the report and select edit.
- On the new dialog box, select actions, and in the drop-down select download report.
- Save the
.RDL
file.
Now we need to modify the .RDL
file for this we need the SQL Server Report Builder.
Open the
.RDL
file in SQL Server Report Builder.When the dialog box prompts Connect to Online SQL Server, select Cancel, and the file will open.
Review the columns on the Excel file that has
#value!
, and compare it with the.RDL
file opened.In SQL Server Report Builder, there are two columns describing one field. The expression for each column will need to be changed by following steps a through e below:
Right-click on the "<expr>" select expression in the drop-down, now new window appears which has expressions for that column:
=IIf(IsNothing(Fields!revenue.Value), Nothing, IIf(("CDbl"="CDate" and CDate(Fields!revenueValue.Value) < CDate("1/1/1900")),Csr(Fields!revenueValue.Value),CDbl(Fields!revenueValue.Value)))
From this identify the field
Fields!revenueValue.Value
.Clear the expression, and in the same window as category select
Field(DSMain)
.Select the expression that we need from the
values
.Note
Here there are two values for each name of a field, and we need to select the field which has value in its name.
In this example, the two fields are revenue, and revenue value.
Select the field Revenue Value in the column name of your report.
For each column, repeat steps a to e.
Once all the field expressions are modified, save the
.RDL
file.In the Microsoft Dynamics CRM Online organization, select the report, and select Edit.
Select the Report type drop-down, select existing file, and then select Save and Close.
Run the report, and export the report to Excel.
The numeric value will now be seen. If you see the value ####, increase the width of the column in Excel.
Note
The steps above will need to be followed for each report that encounters this issue.