If you ever export your data to CSV using Reporting Services, you might notice that the file does not open correctly in Excel (which should usually recognize CSV format). You might also note that programs expecting a standard CSV file will not be able to use CSV files exported from Reporting Services. The reason for this is that the encoding is set to Unicode by default instead of ASCII.
Here is a tip to solve that problem. For SQL Reporting Services 2005, change the config file on the report server as follows:
1. Open the rsreportserver.config file with a text editor and look for this block:
<Extension Name="CSV" Type="Microsoft.ReportingServices.Rendering.CsvRen derer.CsvReport,Microsoft. ReportingServices.CsvRendering"/>
2. Comment out that section with <!-- and --> marks.
3. Directly below that comment section, add the following:
<Extension Name="CSV"
Type="Microsoft.ReportingServices.Rendering.CsvRen derer.CsvReport,
Microsoft.ReportingServices.CsvRendering">
<Configuration>
<DeviceInfo>
<Encoding>ASCII</Encoding>
</DeviceInfo>
</Configuration>
</Extension>
4. Run IISRESTART to reload the configuration file.
If you do not have SQL Reporting Services 2005, you can edit the URL. If you'll notice, the URL strings have parameters in them telling the report how to render. You can force the report to render as CSV and change the encoding to ASCII by placing these in the URL string.
1. Replace this block in the URL:
withCode:rs%3aCommand=Render&rs%3aFormat=HTML4.0
2. Then add the following bit:Code:rs%3aCommand=Render&rs%3aFormat=csv
3. Make sure to append using the ampersand &Code:rc:Encoding=ASCII
4. It should prompt you to download the report. Just open or save it, and your encoding will be correct.



LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks