Parameter-Wrapper for ReportViewer? RRS feed

  • Question

  • Hello,


    my question is: Have someone write a undependent wrapper for users parameters-input?


    Why I need that: 2 situations descripe my proplems


    Situation 1: I have write a report with 2 parameters and one report with 5 parameters. Now I want a usercontrol that open the report and generate a formular with the needed parameters. After the user have fill out the parameters he can press "OK" and the report will generate


    Situation 2: I have a report with 2 parameters (EmployID). Now I need the formular (dynamic generated) that ask for the needed country (I have a table with all countries and their ID´s). After select that, a second listbox filled with all employies in this country (i have a table with countryid and employid). After select that the user press "OK" and the report would be generated.


    How can I solve that? Have someone a good link for me? Know someone a application that have this feature?


    Thank you very much

    Michael Kolowicz

    Monday, January 28, 2008 8:13 AM


All replies

  • I am looking for a custom report parameters toolbar for other reasons:
    1. Need to use custom icons and apply CSS styling to controls to achieve consistent look and feel with the rest of the application, apply themes.
    2. Customize parameter prompt widths and number of parameter columns and their widths.
    3. Customize width of the textboxes and limit their text width, use multi-line textboxes and client-side validation.
    4. Display inline error messages instead of annoying pop-up dialog boxes.
    5. Use other types of controls to select multiple values (e.g. use multi-column checkbox list in a modal dialog box). RS Viewer control has usability issues when it comes to selecting 20-40 values from a 400 values list.
    6. Display parameter values, but do not allow user to modify them (disable edit).
    7. Utilize AJAX to avoid unnecessary postbacks with much faster refresh time compared to postbacks initiated by the ReportViewer control in async mode.
    8. Have better cross-browser compatibility.

    I tried to find a solution and the only thing that comes close is the Telerik Reporting.

    If report viewer were a template control, of if it exposed a delegate to instantiate user input controls, these issues would have been much easier to overcome.

    I actually started building such control, but I am afraid we may go ahead with the Telerik Reporting if it proves to be a good product or Microsoft is going to release a new WPF-based report viewer by the time I finish building mine ;-)

    In your case, you can call ReportViewer.ServerReport.SetParameters.
    It accepts a list of ReportParameter values that you can mark hidden. E.g.

    #region  CODE SAMPLE


    string value1;
    string value2;

    // Get current values for the two parameters
    ReportParameterInfoCollection parameters = ReportViewer.ServerReport.GetParameters();

    foreach(ReportParameterInfo parameter in parameters)
    if (parameter.Name=="ParameterOne") value1 = parameter.Value[0];
    if (parameter.Name=="ParameterTwo") value2 = parameter.Value[0];

    // Calculate defaults for the invisible parameters
    string default1 = FunctionOne(value1, value2);
    string default2 = FunctionTwo(value1, value2);
    string default3 = FunctionThree(value1, value2);

    // Visible parameters
    List<ReportParameter> list = new List<ReportParameter>();
    list.Add(new ReportParameter("ParameterOne", value1, true));
    list.Add(new ReportParameter("ParameterTwo", value2, true));

    // Hidden parameters
    list.Add(new ReportParameter("ParameterThree", default1, false));
    list.Add(new ReportParameter("ParameterFour", default2, false));
    list.Add(new ReportParameter("ParameterFive", default3, false));


    #endregion CODE SAMPLE

    In this instance, you will set all 5 parameters, except only 2 will be visible to user.


    Ruslan Urban

    Sunday, February 3, 2008 3:22 AM
  • Ruslan,
    how is going with your "report parameters toolbar"?

    I have the same problem :)
    I would buy terelik, but it seems where is no support for end-user reports and RDL-like templates .

    Regards, Artur

    Sunday, August 3, 2008 10:53 PM
  • I mananged to get it working. It is a bit ugly, but works with the app.
    • Marked as answer by MyKey0815 Sunday, January 23, 2011 1:28 PM
    Friday, July 17, 2009 8:08 PM