1
votes

SSRS, 2008R2.

I'm trying to avoid the report auto-running. From what I've read, if you have a required parameter with no default value, then your report will not auto-run. I have default values on all of my parameters, except for one, but that parameter is nullable.

In VS, I set this parameter to not use an optional value, but when I preview in VS, or publish to SSRS and load it, the report auto-runs, with a default value of Null. In SSRS when I manage the report, it shows Null as the default value. I can uncheck it in SSRS and save it there, but I'm trying to avoid making changes directly on the SSRS server, and would rather do it in the RDL.

Actually, what I really need is the parameter to not get assigned a default value of Null, inside of VS (in the RDL) instead of having to mark it on the server.

If I remove the nullable option for the parameter in VS, then it doesn't auto-run, but Null is a valid value for this parameter.

I've read some hacks like putting in another parameter that's not used, or manipulating the HTML/CSS when rendering the report viewer to the user, but I'm hoping for a real solution that doesn't require any hacks or any changes on the SSRS server.

This is a date/time parameter, if that matters.

Any thoughts?

1
Have you tried opening the code view and looking at your nullable parameter? Maybe it's got a default value tag that you can remove.Tab Alleman
Yep, there's nothing there, just <ReportParameter Name="EnterDateTo"> <DataType>DateTime</DataType> <Nullable>true</Nullable> <Prompt>Enter Date To</Prompt> </ReportParameter>Joe Enos
It's kind of a hack, but I think I would make the parameter non-nullable, and offer an option that has "NULL" for a label, but passes something like "1/1/1900" for a value, which your back-end SQL would have to translate to NULL. I don't know of any less hack-y solution.Tab Alleman
I'll suggest it as an answer in case you decide to go with it. :)Tab Alleman

1 Answers

1
votes

It's kind of a hack, but I think I would make the parameter non-nullable, and offer an option that has "NULL" for a label, but passes something like "1/1/1900" for a value, which your back-end SQL would have to translate to NULL. I don't know of any less hack-y solution.