Passing parameters to a report
February 8, 2011 Leave a comment
Lately we’re getting more and more interest from multitenancy SaaS providers and OEM partners who want to integrate RSinteract into their web applications. A really useful feature of RSinteract is the ability to link to a report from a 3rd party application and pass filter values and UI parameters on the URL.
To do this with a report based on a SQL Server or Oracle data source:
- Create a report with filters, or use this sample report which comes with RSinteract: http://localhost/RSinteract/?/RSinteract+Samples%2fOrders+by+Category
- Open the report and hover over the parameter in the left hand sidebar
- Note the RDL field: Fullname
- Add the parameter name and value to the URL:
- http://localhost/RSinteract/?/RSinteract+Samples%2fOrders+by+Category&Fullname=Pak,%20Jae
- Separate the parameters with &
- Replace any spaces with %20
- Parameter names are case-sensitive
- For Between filters you actually have two parameters: add _0 and _1 to the RDL field:
For a report based on an Analysis Services OLAP data source:
- Create a report with filters, or use this sample report which comes with RSinteract: http://localhost/RSinteract/?/RSinteract+Samples%2fSales+by+Country+(OLAP)
- Open the report and hover over the parameter in the left hand sidebar
- Note the RDL field: Date_Fiscal
- Hold ctrl and double click on the empty bit of sidebar below the Filters panel, click OK to hide the popup message and you’ll see the Reporting Services toolbar at the top of your report
- Note the parameter value {[Date].[Fiscal].[Fiscal Year].&[2004]}
- Remove the braces { }
- Change ampersands to %26
- Change [ to %5b
- Change ] to %5d
- Separate the parameters with &
- Replace any spaces with %20
- Parameter names are case-sensitive
- Put your new URL together by adding: &Date_Fiscal=%5bDate%5d.%5bFiscal%5d.%5bFiscal%20Year%5d.%26%5b2003%5d
- Try your new URL …Sales+by+Country+(OLAP)&Date_Fiscal=%5bDate%5d.%5bFiscal%5d.%5bFiscal%20Year%5d.%26%5b2003%5d
Notes:
- Any errors in the report frame are probably due to invalid parameters – if you’re not sure about your parameter values then paste them directly into the Reporting Services toolbar and hit the “View Report” button
- You don’t need to pass all of a report’s filter parameters on the URL, those not passed will use the normal report defaults.
- If your Filters tab has the ‘Always Ask’ option ticked you’ll need to add “&rsi:noq=1” to the URL to tell RSinteract not to show the question screen.
- The rsi:noq=1 option only works if all parameters in the report have a default value or a value is passed on the URL.
- Make sure you keep everything case sensitive.
