8

Is there any way of turning off the header for a CSV export on just one SSRS report?

I'm using Report Builder 3 and I deleted the headers from the report, but when exporting to CSV they're back. I can't find anywhere to turn them off.

I've seen this question but it seems to cover all reports on the server, I only need to turn the headers off for a couple.

2
  • Do you want to export directly from Report Builder or can you deploy o the report server first and then export? If from Report Builder, the answer is no. If you can deploy to the report server, maybe.
    – Stacia
    Commented Jul 18, 2012 at 20:50
  • Exporting with a data driven subscription on the server. But I can't get rid of the header either from the server or directly in Report Builder. Commented Jul 19, 2012 at 1:39

4 Answers 4

18

However you implement this (custom assembly, custom rendering extension), you will need to touch some of the config files on the server, unless you are sending the deviceinfo parameter with the URL, or rendering the report programmatically from an external app.

The easier approach is server wide, and you leave the current CSv extension alone and is very easy to implement. Luckily for you (and me), this is something that can be done with hardly any code at all.

Since this is one of the deviceinfo parameters for the CSV extension, all you have to do is add the following lines of code into the RSReportServer.config file. You are adding another extension here by using the current CSV one.

<Extension Name="CSV (No Header)" Type="Microsoft.ReportingServices.Rendering.DataRenderer.CsvReport,Microsoft.ReportingServices.DataRendering">
    <OverrideNames>
       <Name Language="en-us"> CSV No Header</Name>
    </OverrideNames>
    <Configuration>
       <DeviceInfo>
          <NoHeader>true</NoHeader>
       </DeviceInfo>
    </Configuration>
</Extension>

Place this in the line below the CSV extension line of code that's already there, or anywhere inside the Render element.

This will allow you to subscribe to the report using that new extension or to export the report using the drop down menu, as sql server reporting services queries that xml file when populating the drop down menu.

If you do use a button and instantiate Reportexecutionservice, you will have to touch the config files anyway to use the .dll.

7

You can't do anything with the data driven subscription out of the box. It might be possible to write a custom subscription extension to do it. You also cannot do anything about exporting directly from Report Builder, unless you did something clever like add a freestanding textbox that looks like a button and then associate an action with it that creates a URL for you to open/render a report using URL Access. You can see some information here: http://msdn.microsoft.com/en-us/library/ms155046.aspx.

With URL Access you can pass in the CSV device info, in your case NoHeader=true as per http://msdn.microsoft.com/en-us/library/ms155365.aspx

1
  • 1
    Yep, looks like there's no way to do it. Commented Jul 24, 2012 at 0:32
5

Adding this:

<Extension Name="CSV (No Header)" Type="Microsoft.ReportingServices.Rendering.DataRenderer.CsvReport,Microsoft.ReportingServices.DataRendering">
<OverrideNames>
   <Name Language="en-us"> CSV No Header</Name>
</OverrideNames>
<Configuration>
   <DeviceInfo>
      <NoHeader>true</NoHeader>
   </DeviceInfo>
</Configuration>
</Extension>

To the config file here: C:\Program Files\Microsoft SQL Server{INSTANCE}\Reporting Services\ReportServer\rsreportserver.config (In the section)

Will create another option in the dropdown list of export options but will still use the CSV Format (Microsoft.ReportingServices.DataRenderer) so the users can still choose per report which format they want.

2
  • 1
    Thanks for this! I corrected a small but crash-induction error in the XML Extension tag, but otherwise it worked perfectly. Commented May 21, 2013 at 14:25
  • 3
    glad to help, I should add that after adding this I had to manually recycle the SSRS service before it took notice of the config change.
    – g7876413
    Commented May 24, 2013 at 17:29
4

For those looking for an export option using only URL access, as suggested by @Stacia, you can request a CSV export with the no header option, just include this in your request: rc:NoHeader (namespace is rc: not rs:)

Sample URL: http://localhost/ReportServer/?ReportName&rs:Command=Render&rs:Format=CSV&rc:NoHeader=true

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.