HTML5 Report Viewer and Parameter.AllowNull

2 posts, 0 answers
  1. Sebastian
    Sebastian avatar
    3 posts
    Member since:
    Jul 2012

    Posted 11 Dec 2013 Link to this post

    Hi,

    it is quite common for our reports to have optional parameters. In the WinForms viewer, they can be left empty by checking the "null" box next to them. The HTML5 viewer on the other hand, does not provide a way to do so.
    Sadly, our customers were not satisfied with the presentation of available parameter values as a list. Therefore, we extended the default parameter editors with kendo select boxes via the options object. While we can now choose to leave parameters empty on the front end, the parameter validators still require the array of available values to contain an empty entry.

    Is there a way to allow empty parameters without adding null to the parameter's data source? Doing so would have side effects on our WinForms application.

    Kind Regards
    Axel Wilczek
  2. Stef
    Admin
    Stef avatar
    3053 posts

    Posted 14 Dec 2013 Link to this post

    Hello Axel,

    We can suggest you two approaches which can be used independently the selected technology:
    1. Change the report parameter MultiValue property to true and handle the selection in the query using COALESCE for instance:
      SELECT        Job.*, Client.*
      FROM          Client INNER JOIN
                           Job ON Client.ClientID = Job.ClientID
      WHERE  COALESCE(@ClientID, NULL) IS NULL OR Job.ClientID in (@ClientID)
    2. Instead of using AllowNull add a value to the report parameter's AvalableValues.DataSource data. Thus you can interpret the additional value as required, and this interpretation will be the same for any viewer.

    Let us know if you need any further help.

    Regards,

    Stef
    Telerik

    New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

  3. DevCraft banner
Back to Top