Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
coolerbob
Aged Yak Warrior
841 Posts |
Posted - 2007-09-06 : 08:04:15
|
I don't want to use SSRS's GUI for parameter entry. It's quite minimal and not very easy to use for users and doesn't cope very well with large selection lists (E.g if you wanted to select 3 companies from a list of 60 000 to run a report for).So I want to make my own parameter entry screen and then pass only the user parameter value selection on to the report parameters.Can I do that? Are the parameters exposed?I'd wanna do something like:My_SSRS_Rep.param1=@MyValFromMyApp1My_SSRS_Rep.param2=@MyValFromMyApp2My_SSRS_Rep.Run/Refresh/ViewCurrently I just have a Windows form with a web browser control in it.And I've set the url to http://myserver/reportserver?%2fDB+Report+Server%myRep&rs:Command=RenderSo it is possible?Or do I need to go about this some other way like using the SSRS Report Viewer or some other mechanism?Answer:http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=88484Report Viewer it is then!UPDATE1:Or maybe not...When I do the following, the report does not refresh: Dim param(0) As Microsoft.Reporting.WinForms.ReportParameter param(0) = New Microsoft.Reporting.WinForms.ReportParameter("Test", a) Me.ReportViewer1.ServerReport.SetParameters(param)Me.ReportViewer1.ServerReport.Refresh()Anyone know why? |
|
jhermiz
3564 Posts |
Posted - 2007-09-07 : 13:12:07
|
quote: Originally posted by coolerbob I don't want to use SSRS's GUI for parameter entry. It's quite minimal and not very easy to use for users and doesn't cope very well with large selection lists (E.g if you wanted to select 3 companies from a list of 60 000 to run a report for).So I want to make my own parameter entry screen and then pass only the user parameter value selection on to the report parameters.Can I do that? Are the parameters exposed?I'd wanna do something like:My_SSRS_Rep.param1=@MyValFromMyApp1My_SSRS_Rep.param2=@MyValFromMyApp2My_SSRS_Rep.Run/Refresh/ViewCurrently I just have a Windows form with a web browser control in it.And I've set the url to http://myserver/reportserver?%2fDB+Report+Server%myRep&rs:Command=RenderSo it is possible?Or do I need to go about this some other way like using the SSRS Report Viewer or some other mechanism?Answer:http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=88484Report Viewer it is then!UPDATE1:Or maybe not...When I do the following, the report does not refresh: Dim param(0) As Microsoft.Reporting.WinForms.ReportParameter param(0) = New Microsoft.Reporting.WinForms.ReportParameter("Test", a) Me.ReportViewer1.ServerReport.SetParameters(param)Me.ReportViewer1.ServerReport.Refresh()Anyone know why?
I've posted the answer to this hundreds of times in the past. Just like a recent post that Kristen hoped on to you do not have to use the RS interface to select your parameters. Please reference the previous post about using the Office Web Components export. This will give you a url with all your selected parameters. This is the example you can use to build your own URL.THink about this, when you select parameters in a report and click "View Report" all RS is doing is putting together a URL with parameters and opens that report with those parameters. What it does to the end user is hide these details so that he / she does not see a long url like this:http://reports.yourserver.com/myReports/CustomerReport.aspx?CustomerID=9&ProductID=10&UserID=20The url has three parameters in which the user has selected from the report viewer interface. Without using any of the objects or parameters that you have posted you can compose this string in any interface, be it web based or form based. Your interface could be 3 combo boxes, one for customer id, another for product id, and finally the last could be a session variable or another private variable, namely the user id. So once you pull this information you can generate the string in your web / form interface by concatenating your Report URL with the parameters you selected and open this URL via javascript or any other means used to open a web page.That is why I said in the previous topic to run a report that has parameters(any report for that matter). And then select some parameters, do a view report, and then export that report using the web components selection (cant remember the exact name but its not pdf, excel or rtf its the other one). This will open a new window with the URL generated by RS. Take that URL and dissect it, it will give you ideas of how you want to pass parameters.Maybe I should create a video on this, its been asked so many times and the solution really is simple. It is hard keeping up with the posts and being married so I am trying my best :).JonWeblog -- [url]http://weblogs.sqlteam.com/jhermiz[/url] |
 |
|
jhermiz
3564 Posts |
|
coolerbob
Aged Yak Warrior
841 Posts |
Posted - 2007-10-01 : 08:16:30
|
Thanks guys, I'll play with that. What if 200 guids were selected as the parameter values? Can the URL cope with such a length?To answer my own question:Replace this:Me.ReportViewer1.ServerReport.Refresh()with this:Me.ReportViewer1.ServerReport.RefreshReport() |
 |
|
Kristen
Test
22859 Posts |
Posted - 2007-10-01 : 08:32:58
|
"Can the URL cope with such a length?"I doubt it using GET, but should be OK if using POSTKristen |
 |
|
|
|
|
|
|