Monday, March 26, 2012

Reporting Services 2005 - CSV - ASCII - £(Pound symbol)

Hi

We are having problems getting Reporting Services 2005 to export to an ASCII CSV file and correctly produce a £(GBP sign).

I have changed my report server .config file to read:

<Extension Name="CSV1" Type="Microsoft.ReportingServices.Rendering.CsvRenderer.CsvReport,Microsoft.ReportingServices.CsvRendering">
<OverrideNames>
<Name Language="en-UK">CSV - UTF-8</Name>
</OverrideNames>
<Configuration>
<DeviceInfo>
<Encoding>UTF-8</Encoding>
</DeviceInfo>
</Configuration>
</Extension>
<Extension Name="CSV2" Type="Microsoft.ReportingServices.Rendering.CsvRenderer.CsvReport,Microsoft.ReportingServices.CsvRendering">
<OverrideNames>
<Name Language="en-UK">CSV - UTF-7</Name>
</OverrideNames>
<Configuration>
<DeviceInfo>
<Encoding>UTF-7</Encoding>
</DeviceInfo>
</Configuration>
</Extension>
<Extension Name="CSV3" Type="Microsoft.ReportingServices.Rendering.CsvRenderer.CsvReport,Microsoft.ReportingServices.CsvRendering">
<OverrideNames>
<Name Language="en-UK">CSV - ASCII</Name>
</OverrideNames>
<Configuration>
<DeviceInfo>
<Encoding>ASCII</Encoding>
</DeviceInfo>
</Configuration>
</Extension>

And so far so good I get the three options to export to,

If I Export using the ASCII Rendering my pound signs come out as question marks (?) and subsequently loads into Excel as a general data type and is not sum-able.

If I Export using UTF-8 Rendering my pound signs come out as a weird character followed by a pound sign, again opened in excel loads as a General data type and is not summable.

If I export using UNICODE rendering, by file sizes are doublesd as you would expect, and then when you open in excel it is all bunched up in column 1, both un-acceptable.

Interestingly enough If I take the UTF-8 file I have and convert it to ASCII using Ultraedit, notepad or wordpad, everything works fine, the £ is correctly encoded, Excel loads it OK and it is summable, result, but I can not use get my end users to perform this "kludge" for an export.

Any help would be appreciated

Thanks

Tim

Hi Tim,

Excel, for some reason, has a problem opening comma separated files with Unicode encoding. This is why you are seeing all of the columns smashed together. In order to get Excel to properly open a Unicode file you should switch to using a tab delimiter. Unfortunately due to a product issue, tab delimiters are not settable in the server configuration file. They are settable when rendering using the URL. Example:

http://server/reportserver/?/myreport&rs:Command=Render&rs:Format=CSV&rc:FieldDelimiter=%09

As for the pound symbol being interpreted as text, I find that if I switch my machine to a en-UK locale this works fine. I can repro your issue when my machine is en-US. Can you verify this?

Thanks,
Chris

|||

Thanks for the pointers here.

Unicode is not ideal for us due the doubling of file size, and we are not using the URL method of rendering so tab delimited is out.

So on to your other comments, I have been trying all morning to make it not produce a ? (question mark)

1. The Local of the machine is definately en-UK, this is the only loaded local
2. The language property of the report in Report designer was set to English (United States), thought I had found it : )

But this changed to English(United Kingdom) re-deployed IIS reset and re-run, exactly the same ? instead of £ when exporting to ASCII, and odd character then £ in UTF-8

Out of interest the way we have forced the display of the £ symbol is using the Format property in report designer setting it to : £#,##0.00;(£#,##0.00)

I am interested how you have managed to re-create by changing the locale ?

Thanks for your help

Tim

No comments:

Post a Comment