Export Unicode CSV from SQL Server Report Server

I am using SQL Server Report Server from Microsoft SQL Server 2005.

The report server report viewing control has a CSV download option. The CSV download option currently downloads a CSV Unicode file that does not load in Microsoft Excel with the correct column formatting.

If I save the Unicode CSV file and convert it to an ASCII file, it works fine in Excel.

How can I install a report or SSRS report viewer to export CSV as ASCII instead of Unicode?

Thanks in advance for your help.

+4
source share
4 answers

Go to the RSReportserver.config file (it should be in the root folder of your virtual report server directory, for example, " C: \ Program Files \ Microsoft SQL Server \ MSSQL.3 \ Reporting Services \ ReportServer ")

Finding a CSV extension should look something like this. Change the node encoding to read ASCII instead of the Unicode or whatevr that you have there.

<Extension Name="CSV" Type="Microsoft.ReportingServices.Rendering.CsvRenderer.CsvReport,Microsoft.ReportingServices.CsvRendering"> <Configuration> <DeviceInfo> <Encoding>Unicode</Encoding> </DeviceInfo> </Configuration> </Extension> 
+6
source

Additional information at http://msdn.microsoft.com/en-us/library/ms156281.aspx . You can create several extensions, that is, in addition to the default CSV, you can add "CSV-ASCII" or "CSV-Pipe", etc.

+2
source

Just for completeness, here you can add the export option "CSV-ANSI". You need to add the tag "OverrideNames" so that you do not get duplicate "CSV". Since I'm in Australia, I needed to add the "en-AU" parameter, you can remove it if you don't need it (or replace it with your own language).

 <Extension Name="CSV-UTF8" Type="Microsoft.ReportingServices.Rendering.DataRenderer.CsvReport,Microsoft.ReportingServices.DataRendering"> <OverrideNames> <Name Language="en-US">CSV (UTF8)</Name> <Name Language="en-AU">CSV (UTF8)</Name> </OverrideNames> </Extension> <Extension Name="CSV-ANSI" Type="Microsoft.ReportingServices.Rendering.DataRenderer.CsvReport,Microsoft.ReportingServices.DataRendering"> <OverrideNames> <Name Language="en-US">CSV (ANSI)</Name> <Name Language="en-AU">CSV (ANSI)</Name> </OverrideNames> <Configuration> <DeviceInfo> <Encoding>ASCII</Encoding> </DeviceInfo> </Configuration> </Extension> 
+1
source

The save button has a small drop-down menu that says "Save with encoding", where you can specify the encoding type as ansi ~ Frame

0
source

All Articles