0

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.

Alan
  • 1,479
  • 3
  • 20
  • 36

1 Answers1

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

Community
  • 1
  • 1
Dominique
  • 4,272
  • 1
  • 16
  • 21