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

AllowNull handling on drop downs and dates

3 Answers 60 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Stanislav
Top achievements
Rank 1
Stanislav asked on 03 Jul 2014, 03:34 PM
Hi,

configurable parameters in telerik reporting is a great feature which saves me a lot of time in allowing to avoid coding my own solution.
Actually, when defining a parameter with AllowNull = true on a drop down or date field a checkbox "NULL" apperas near the field. I would rather prefer to have something like "Please select" to be treated as null value on drop downs or nothing entered in the date boxes.

Is there a way to achieve this behavior in telerik reporting?

Regards

3 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 07 Jul 2014, 01:17 PM
Hello Stanislav,

If you are using the report parameter's AvailableValues, you can add a value, which to be interpreted as needed in the data retrieval method.
For example if you use a SqlDataSource component for a parameter's AvailableValues.DataSorce, you can use Union in the SQL query to add a record. Then in the main data source component you can check if the value of the parameter is the additional one and decide what data to return. You can set this value to be selected by default.

I hope this information helps you.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Stanislav
Top achievements
Rank 1
answered on 08 Jul 2014, 06:58 AM
Hello Stef,

thank you for the suggestion, but my intention is actually to use telerik functionality to avoid adding a default value to the drop-down on my own. And, with the NULL handling, this handling is already there, one more thing left is the UI tweak. Is there a chance this tweak will find its way into the reporting component?

Regards
0
Stef
Telerik team
answered on 10 Jul 2014, 04:08 PM
Hello Stanislav,

The existing functionality to pass a Null value is to set the parameter's AllowNull to true, which depending on the selected viewer appears as a check-box next to the parameter or allows the initial rendering of the report without specified parameters values.

The recommended approach for custom scenarios where a report parameter's value can be interpreted as Null,  'select all' or other, is to add a specific value in the data for the parameter's values, or specify a value (text, date range, number range) in which the value should be handled as a special case. Having such specific value, beside the AllowNull functionality, is discussed and due to the various interpretations and usage it may have is not considered as applicable for now.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

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