| Summary: | [Scripting usability] ability to use an expression as default parameter value | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Vladimir <vladperl> |
| Component: | BIRT | Assignee: | Haojun Chu <hchu> |
| Status: | VERIFIED FIXED | QA Contact: | Maggie Shen <lshen> |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | belcore_walter, bluesoldier, etiennel, jerlich, kvenkatraman, rkanguri, thibaudr, whe, zqian |
| Version: | unspecified | Keywords: | plan |
| Target Milestone: | 2.5.0 M6 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | Autoed | ||
| Bug Depends on: | |||
| Bug Blocks: | 264273 | ||
|
Description
Vladimir
A couple of alternatives: 1. Parameter selection list can specify the default value on that list. 2. Use custom parameter collection UI, where the default values can be completely customized. 3. support scripting on parameter objects, for example, allow script of getDefaultValue() and getSelectionList() on a parameter object. very important future. I hope that this wil be correct into next version. Any news on this? This is very important, specifically with dates parameters where one would want to default to Today and Yesterday! Any news about this feature ? For a DateTime parameter, when the defaultValue comes from a dataSet, there is no workaround to propose to the user a correct and dynamic default value in a text box. It's really a problem. Maybe it's coverred by another feture planned in 2.1.2 or 2.2 ? Thnaks to explain. *** Bug 219421 has been marked as a duplicate of this bug. *** *** Bug 222330 has been marked as a duplicate of this bug. *** BIRT Designer 1) BIRT parameter dialog – Default value UI will be enhance to support expressions. When the expression builder is invoked from this page, it does not show following - 'Report parameters' , 'Available Data Sets' and ‘Available Column Bindings’ nodes, as they are not available in the default value scope. User can write expressions but has not access to data or other report parameters. 2) Scripting enhancement Currently the report parameter script supports following method - "validate' We will enhance the scripts to support following additional methods a) getDefaultValue() // User can implement this method to return default value. Note we have another bugzilla planned to support multiple default values, this method should support multiple default values if the other change is made. b) getSelectionValuelist() // User can implement this method to provide the value list. This method is only called for 'list', 'combo' control parameter type If a user sets the default value and also implements the method, the method value overrides the value set in parameter dialog BIRT Engine - We will use modified model 2, what that means is the execution sequence is fixed and it is done once. - During intialization of IGetParamterDefnTask - The getDefaultValue/getSelectionList() is called and the default value is generated one time and subsequently used when user calls engine API Like IGetParameterDefnTask.getDefaultValue(String name); - During intitalization of IRunTask/IRunAndRenderTask – The getDefaultValue/validate() is evaluated ones and used subsequently. BIRT model How does the user define the the validate()/getDefaultValue()/getSelectionValuelist(), as the expression or script? If we define them as expressions, we need three expressions in the report: validate, defaultValue and selectValueList. Those expressions can’t share the common variable and functions with each other. If we define them as function, we can define them in one script segment. Those methods can share the variable and functions with each other. In current design, we define the “validate” as the expression, so if we prepare to define them as functions, MODEL need wrap the old validate expression to a new function. [ Rima – I think we should adopt the new approach, i.e. to use script with 3 functions ] Reassigning to engine team to make the changes first I've a question.
It's ok to apply getSelectionValueList() to a simple parameter. But for a cascading parameter group which binds to datasets, how to fit the SelectionValueList into the dataset values? Like the following:
Cascading Parameter:
Param A --> binds a dataset column
Param B --> binds a datasetcolumn, also has a SelectionValueList
Param C --> binds a dataset column
I don't have any idea to handle this. Do you have any idea? Or it's ok to disable Scripting on the cascading parameter?
Thanks,
Haojun
Fixed. Checked in on Mar 10. verified on build 2.5.0 v20090317-0630. |