reporting-servicessql-server-2016subscriptiondata-driven

SSRS Data Driven Subscription - Specifying Render format within Query


I have a need to send the same subscription to different people in different format.

I have the data driven subscription query working correctly. Some users need the report rendered and emailed as a PDF and some need it as Excel.

So I simply have a case statement which say something like :

case when username = 'X' then 'EXCELOPENXML' else 'PDF' end as render_format

I then use this under Delivery Options for Email and the Render Format source is "Get value from dataset" and value/Field is render_format

All records that have EXCELOPENXML as render format are delivered successfully but I get the following error in the log file for PDF rendering!

Success: False, Status: The value 'PDF' is not valid for setting 'Render Format'.

I've looked at the report server config file and the render name there is PDF.

Seems rather straight forward, but I'm scratching my head with this simple task.

what is the render format name for a PDF please, cause PDF itself does not work!

The report is delivered as PDF if I use the drop down value as PDF.

Strangely, if I use MHTML it works fine!


Solution

  • I don't have Enterprise to test but the default name is just 'PDF'.

    Unless the config has been changed (but you said you checked that).

    Only thing I can think of next would be to add

    ="[" & Globals!RenderFormat.Name & "]" 
    

    using a monospaced font to a textbox on a test report, manually export the test report as PDF and check the output.

    The [] and font are just to make it easier to spot spaces etc.