SSRS 2012 Bug – “Excel found unreadable content”

Excel Found Unreadable Content - SSRS 2012
Excel Found Unreadable Content – SSRS 2012

 

Excel found unreadable content.
Do you want to recover the contents of this workbook?
If you trust the source of this workbook, click Yes.

I encountered this error while using SQL Server Reporting Services (SSRS) 2012.
The same error message does not appear when using SSRS 2008.
This error happens after exporting your report to an Excel spreadsheet.

When you try to open the Excel file, the above error message appears.
After a lot of trial and error, I discovered that SSRS 2012
has an issue with numeric columns with a precision of 16 or higher.
In this case, my numeric columns were defined as NUMERIC(38,16).

I also tried using the ROUND function in SSRS to round my value to 2 decimal places.
In some cases, this worked. But in other cases, it failed.
When it failed it actually caused a slightly different behavior.
When trying to export to Excel, it actually triggered an unhandled exception in the
web browser (Internet Explorer 11).

The easiest way to fix this problem is to change the data type in your source table.
In my case, I really did not need a precision of 16 decimal places.
In most cases, I would think that 8 decimal places should be more than enough.

If changing the datatype in the source table is not an option, then
you will have to handle this in your stored procedure or query that feeds data to the

report.

You can convert the NUMERIC(38,16) column to let’s say NUMERIC(38,8).

For example:
SELECT CONVERT(NUMERIC(38,8),MyNumericColumn) AS MyNumericColumn_v2

This should help you avoid this error message in the future.
Hopefully, there will be a service pack in the future that fixes this bug
in SSRS 2012.

Until the next time,

Mark Killion

 

4 thoughts on “SSRS 2012 Bug – “Excel found unreadable content”

  1. Hi – I read this article and reviewed the Excel file after converting it to ZIP format as suggested in another post. I found that although the SSRS report displayed the decimal fields with two digits after the period, I was surprised to the data actually had it expressed as 16 digits. So I found the fields in the dataset that had a CASE statement that multiplied fields together (qty * cost for extended cost for example) and explicitly cast them to Numeric(10,2). Re-ran the SSRS subscription and the file opened without errors. Thanks so much for posting your original notes. It saved me tens of hours troubleshooting…..Dave

    • Hello Dave. I am glad this post helped you save some time.
      It definitely is not an obvious error, that’s for sure.

  2. Hi, I had an report using data from a SSAS cube with MDX that had the same problem. In the expressions for the fields that made an division I put an =CDec() funktion arround the expresson. Worked fine and no more excel error. The funkton converts a value to decimal.

    • Thanks for sharing. So apparently this error is caused by a data type
      that Excel can not handle. Hopefully Microsoft will fix this bug soon.

Leave a comment