none
Passing Parameters to webforms reportviewer from winforms. RRS feed

  • Question

  • I have a Windows Form called ReportViewerForm with a web Browser object in it. In my code, I have:

    this.webBrowser1.Url = new Uri(http://prodsql/ReportServer/Pages/ReportViewer.aspx?%2fSurveillance%2fKPISummary&rs:Command=Render&StartDate='01/01/11'&EndDate='01/04/2010');

    I thought that this would pass in the StartDate and EndDate parameters for the ReportViewer so the user didn't have to type in set dates. I did read somewhere that you can have it give the user a pop-up calendar to select a date from instead of passing them in. How do I do that?

    I did have a windows based ReportViewer but it required software we'd have to install on everyones machine so I converted the reports to web based reports and would like to still ask for dates via a calendar form I have and pass those to the web based reports. I hope this makes sense!

    Paul

    Tuesday, January 4, 2011 4:20 PM

Answers

  • Well I'm not sure what changed but it is working now. I can even use the calendars we were using for the windows based ReportViewer. Wow. I hate mystery bugs but this is gone and I can now move on to better and greater things! What I had above is what I use (but now I pass the values of the calendar pickings instead of embedded dates which I didn't want to do anyway.)

    Maybe it was that I finally found where to edit the parameters on the reports (Open report, Make sure you in Layout view and click in the window so nothing is selected, in the Properties window, select ReportProperties, click on the '...' button and there you go.) So I set the default value as the Now for DateTime on both StartDate and EndDate and the report started working! Amazing.

    • Marked as answer by Mesazone Thursday, January 6, 2011 10:56 PM
    Thursday, January 6, 2011 10:56 PM

All replies

  • Well I'm not sure what changed but it is working now. I can even use the calendars we were using for the windows based ReportViewer. Wow. I hate mystery bugs but this is gone and I can now move on to better and greater things! What I had above is what I use (but now I pass the values of the calendar pickings instead of embedded dates which I didn't want to do anyway.)

    Maybe it was that I finally found where to edit the parameters on the reports (Open report, Make sure you in Layout view and click in the window so nothing is selected, in the Properties window, select ReportProperties, click on the '...' button and there you go.) So I set the default value as the Now for DateTime on both StartDate and EndDate and the report started working! Amazing.

    • Marked as answer by Mesazone Thursday, January 6, 2011 10:56 PM
    Thursday, January 6, 2011 10:56 PM
  • What VS ver. are you using?
    I am using c#2010 and don't see anywhere the Report Parameters option.
    When selecting the ReportProperties I just have: Page Setup, Code (what is that?), Reference, and Variables (what is that?)
    No '...' button.

    Could you please help?

     


    ADH
    Wednesday, January 12, 2011 4:00 AM
  • I'm using VS2008. Don't select Report Properties. While you are viewing the report in Layout View, click somewhere in the window so you are not selecting anything. (My back ground color is a beige color.) Under the Solution Explorer, you should have a Properties window (the same one that shows the properties of any object.) In there, select ReportParameters. Then you'll see the elipsis (...). (I see in my previous post I said ReportProperties. That's incorrect. It is ReportParameters.) You can also select from the menu bar, Report, ReportParameters. But you must click on the background somewhere....
    Tuesday, January 18, 2011 4:17 PM
  • Please try this in C#2010....
    ADH
    Sunday, January 23, 2011 6:04 AM