When exporting information from SQL Server Reporting Services in CSV format, it always appends two blank lines after the last row of data in the exported file.
Whilst I can edit the file after the export and remove the blank lines, is it possible to prevent SSRS from producing the two blank lines in the first place?
See the following connect article (and vote for it to be fixed!
Bug 557655 SSRS2008 - Extra blank line in csv files created by csv renderer on export of report.
You need to alter the rendering extenstion setting for csv export in the RSReportServer.config file. Set the Device Info setting for CSV for ExcelMode to false like this:
<Render>
<Extension Name="XML" Type="Microsoft.ReportingServices.Rendering.DataRenderer.XmlDataReport,Microsoft.ReportingServices.DataRendering"/>
<Extension Name="NULL" Type="Microsoft.ReportingServices.Rendering.NullRenderer.NullReport,Microsoft.ReportingServices.NullRendering" Visible="false"/>
<Extension Name="CSV" Type="Microsoft.ReportingServices.Rendering.DataRenderer.CsvReport,Microsoft.ReportingServices.DataRendering">
<Configuration>
<DeviceInfo>
<ExcelMode>False</ExcelMode>
</DeviceInfo>
</Configuration>
</Extension>
The default for the Excel mode setting is true. There is a known bug in the Excel Mode CSV renderer that adds an extra blank line. This workaround will allow you to get around the error. I had to implement this when I moved from SSRS 2005 to SSRS 2008.
Newer versions of SSRS allow you to specify various settings in your report URL query string. To have bottom lines removed just add &rc:ExcelMode=false. More information here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With