0
votes

Is there anyway to pass an optional parameter value as null in SSRS reports without using :isNull=True in Report URL.??

  • I want to generate a SSRS report by firing the URL from the front end application.
  • I will give two inputs as mandatory and another one is optional.
  • if optional input is not given, then the query should be refined accordingly

I want to pass Report URL as "http://localhost/ReportServer/Students+Reports/&RollNo=1234&Name=John&Dept=null&rs:Format=PDF&rs:Command=Render"

I don't know whether I am asking silly or not. Please Help me out. Thanks in advance

1

1 Answers

1
votes

Definitely not a silly question. I have done this within a .NET application.

However the URL is slightly different: You need to use the report viewer, and call the render command inside of the URL. In the below example "ErrorID" is a report parameter.

Example: http://myserver/ReportServer/Pages/ReportViewer.aspx?%20%2fReports%2fErrorManagement%2fErrorReport&rs:Command=render&errorId=6046

In the case for NULL values, the ISNull=True is the only way to accomplish this inside of the URL. Although, shouldn't be a problem. You can set the parameter to a default value of null, inside the report, and also in a stored procedure. When the parameter is not null, pass the parameter into the URL shown above.