Friday, September 7, 2012

Passing report parameters with POST, still hitting length limit

Passing report parameters with POST, still hitting length limit

I have a Silverlight application (meant to be run in a browser) which allows the user to select as many SSRS (sub)reports as they like from a large list. The selected subreports get aggregated into one big report, and this report is launched in a new window. Each subreport has its own set of parameters. As such, the parameter-value list can get very long. Previously, the application would use the GET method to pass parameter values, e.g.:

http://<serverName>/_vti_bin/ReportServer/Pages/ReportViewer.aspx?http://<reportPath>&rs:Command=Render&rs:ClearSession=true&rc:Parameters=false&rc:Toolbar=true&rc:Zoom=100&FacilityUniqueValues=A&WorkWeek=0&... 

But with long parameter-value lists, the URL could easily exceed 2000 characters. At around this length or greater, the report fails -- the browser just gives an HTTP 404 page. I figured this was due to a URL length limit somewhere along the line, so, after looking up solutions, I made it use the POST method to pass parameters, exactly as described in this SO answer. The URL above would now just look like:

http://<serverName>/_vti_bin/ReportServer/Pages/ReportViewer.aspx?<reportPath> 

However, the problem persists exactly as before when the parameter-value list is long.

I noticed that, when the list is shorter and the report is shown successfully, the browser redirects to a URL in the form:

http://<serverName>/_layouts/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=<relativeReportPath>&rv%3aParamMode=Hidden&rv%3aZoom=100&rp%3aFacilityUniqueValues=A&rp%3aWorkWeek=0&... 

i.e. The values are made into GET parameters anyway. I don't understand this, as I've seen many recommendations to use POST for getting around URL length limits when you have a lot of report parameters -- what's the point if it redirects to a GET URL?

So, is there a way to propagate the Posted parameters? Or another way around this problem?

I'm very inexperienced with most of the technologies involves, so I apologize for any relevant details I have not included -- please let me know what info may be helpful.

Answers & Comments...

Answer: 1

The reporting server you are connecting to is redirecting to a page and specifying the subreports as URL arguments. This is an issue in the reporting server and is not something you can fix in the Silverlight application.

by : aktonhttp://stackoverflow.com/users/1634846




No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog