SSRS 2005 Set SimplePageHeaders on the report instead of the server?
Asked Answered
S

1

8

I have one report that does not export to excel friendly from SSRS 2005. I know I can use


<Render>
    <Extension Name="EXCEL" Type="Microsoft.ReportingServices.Rendering.ExcelRenderer.ExcelRenderer,Microsoft.ReportingServices.ExcelRendering">
        <Configuration>
            <DeviceInfo>
                <SimplePageHeaders>True</SimplePageHeaders>
            </DeviceInfo>
        </Configuration>
    </Extension>
</Render>

in the rsreportserver.config, but I am not the only person with reports on this machine. I also found that you can pass

&rc:SimplePageHeaders=True
in the url to export the report programatically.

I tried adding the &rc:SimplePageHeaders=True to the end of the url when navigating to the report manager, but when I select excel from the dropdown and click export the headers are still exported. I even tried setting the rc:Command=Render and rc:Format=EXCEL in the url too without any luck.

Is there a way to do what I am trying to do?

note: I am wanting to render the report on the built in report manager and use the build in export to excel dropdown, not in an app or website.

Sordid answered 15/6, 2010 at 19:29 Comment(0)
B
29

Instead of overriding the existing Excel renderer, what you want to do is supply another renderer that strips out the headers and include this in the list of renderers available to the export menu. You almost have the solution - instead of modifying the current Excel renderer you want to supply another one. There are a couple of tricks here:

  • You must give this renderer a name that is different to the current Excel renderer which has Name="EXCEL" on my system, otherwise you will only see one Excel renderer
  • The displayed name of the renderer will not be the name you called it above, but will simply be Excel as that is the display name supplied by the renderer, so you will see two options called Excel and you won't know which is the one without page headers.
  • Consequently you must override the name
  • When you override the name, you must specify the language that you are overriding it for. The language value that you set must be valid for the report server computer. For example, if the report server is running on a French operating system, you should specify "fr-FR" as the attribute value. I'm using "en-AU" as I am Australian, you would use "en-US" if you are in USA.

Thus, under the current EXCEL renderer (don't replace the existing one) in <Render> section of rsreportserver.config, you would insert something like:

<Extension Name="EXCEL (No Header)" Type="Microsoft.ReportingServices.Rendering.ExcelRenderer.ExcelRenderer,Microsoft.ReportingServices.ExcelRendering">
    <OverrideNames>
        <Name Language="en-AU">Excel (No Header)</Name>
    </OverrideNames>
    <Configuration> 
        <DeviceInfo>
            <SimplePageHeaders>True</SimplePageHeaders> 
        </DeviceInfo> 
    </Configuration> 
</Extension>

This will give you two Excel options on the Reporting Services export menu: Excel and Excel (No Header)

Don't forget to change the language attribute in <OverrideNames> to the language on your report server or both options will simply be called Excel

Bazan answered 17/6, 2010 at 2:47 Comment(1)
This works great for eliminating the header section, but it is also eliminating my tablix header, and freezing the first row instead of using the tablix header. How do I prevent that?Fidelia

© 2022 - 2024 — McMap. All rights reserved.