Can I include javascript in the property binding Query Text field of a BIRT report Data Set? The reason why I want to do this is to select a query depending on a report parameter passed by the user.
Asked
Active
Viewed 937 times
0
-
Dominique already answered this question. – Alan Jan 22 '15 at 12:51
1 Answers
1
Yes, for instance you can do this in this field:
var param=params["myParameter"].value;
if (param==1){
"select code,label from tableA";
}else{
"select code,label from tableB";
}
However this makes reports more difficult to maintain. Most of the time it is a better practice to modify an existing queryText from "beforeOpen" method of the dataset, by replacing keywords such explained in this topic
-
Replacing keywords, as you suggested and explained, is much more elegant, indeed. – Alan Jan 22 '15 at 08:39