Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Non-Unicode CSV Export from SQL Server Report Server

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

In the report server report viewer control, there is a CSV download option. The CSV download option is currently downloading a Unicode CSV file, which does not load into Microsoft Excel with the correct column formatting.

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

How can I can I set a report or the SSRS Report Viewer to export CSV as ASCII instead of Unicode?

Thanks in advance for any help with this.

like image 551
Steve Stedman Avatar asked Dec 30 '22 03:12

Steve Stedman


1 Answers

Go to the RSReportserver.config file (should be in the root of your reportserver virtual directory e.g. "C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer")

Find the CSV Extension - should look something like below. Change the Encoding node to read ASCII instead of Unicode or whatevr you have in there.

        <Extension Name="CSV" Type="Microsoft.ReportingServices.Rendering.CsvRenderer.CsvReport,Microsoft.ReportingServices.CsvRendering">
            <Configuration>
                <DeviceInfo>
                    <Encoding>Unicode</Encoding>
                </DeviceInfo>
            </Configuration>
        </Extension>
like image 123
Nick Meldrum Avatar answered Jan 08 '23 16:01

Nick Meldrum