Search code examples
excelssrs-2008reporting-services

SSRS Excel Export with Expression in header


I'm Exporting from SSRS to Excel using SimplePageHeaders=True. (This is because there is a user requirement is for no headers in the worksheet, but only on print out).

That all works fine, but the textbox in my header contains an expression, i.e. it looks like this:

Report Name «Expr»

Where «Expr» is as follows:

=Format(Fields!CurrentMonthDate.Value, "MMM") & " " &
     CStr(Year(Fields!CurrentMonthDate.Value))

When I view the report, this expression works as expected, i.e. outputs as:

Report Name Nov 2012

But when I export to Excel, and look at the page setup or print preview, the header comes out as:

Report Name

i.e. the expression result has gone.

Is there any way to keep the expression result in the Excel Header? (without requiring the user to do anything in Excel).


Solution

  • It seems that you have placed the Expression under placeholder in the textbox. Try to use a single textbox expression as

    =” Report Name ”+ Format(Fields!CurrentMonthDate.Value, "MMM") & " " & CStr(Year(Fields!CurrentMonthDate.Value))