Steve Stedman
Steve Stedman

Reputation: 713

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.

Upvotes: 4

Views: 15364

Answers (4)

Rocklan
Rocklan

Reputation: 8130

Just for completeness here's how you go about adding a "CSV-ANSI" export option.You'll need to add an "OverrideNames" tag so that you don't get duplicate "CSV" options. As I'm in Australia I needed to add a "en-AU" language option, you can remove it if you don't need it (or replace 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>

Upvotes: 2

sfuqua
sfuqua

Reputation: 5853

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

Upvotes: 2

Ramachandran
Ramachandran

Reputation:

In the save button there is small drop down menu which says "Save with encoding" where you can specify the encoding type as ansi ~Ram

Upvotes: 0

Nick Meldrum
Nick Meldrum

Reputation: 1171

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>

Upvotes: 6

Related Questions