dkleehammer
dkleehammer

Reputation: 441

SSRS served files named Resource.aspx, try to open, receive message file with same name already open

We are using SQL Server 2008 R2.

In SQL Server Reporting Services when an excel file being served is opened by the user, the default name it receives is "Resource.aspx" which is ok, but when the user tries to open another excel file, excel complains that there is a document with the name "Resource.aspx" is already open. At this point, clicking the 'OK' button will still open the second file just fine.

Is there a way to fix SSRS/IIS to serve the file using the name that it was uploaded with?

Upvotes: 1

Views: 595

Answers (1)

dkleehammer
dkleehammer

Reputation: 441

I found out how to fix this. The MIME Type in the report properties is set to 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' by default, this is for Excel 2003. You must set the MIME Type to 'application/octet-stream' to work properly with Excel 2007+.

The MIME type tells the browser what type of stream the response is. IE didn't know MIME type and opened the requested file (ASPX was using Request.aspx as the serving filename) as the data that needed to be returned.

Setting the MIME Type will open the file using the uploaded name, e.g. 'Sales Report.xlsx'.

Upvotes: 2

Related Questions