This is a migrated thread and some comments may be shown as answers.

HTML5 Report Viewer and Parameter.AllowNull

1 Answer 178 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sebastian
Top achievements
Rank 1
Sebastian asked on 11 Dec 2013, 11:53 AM
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

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 14 Dec 2013, 02:48 PM
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.

Tags
General Discussions
Asked by
Sebastian
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or