Change display text on parameter [message #1843025] |
Mon, 12 July 2021 05:07  |
Eclipse User |
|
|
|
Hi,
I am new to BIRT and I have created a parameter for my report to filter by if a document has been sent or not.
In our database 0 = No and 1 = Yes
I want the combo box to show Yes and No instead of 0 and 1
I have used the following code in the expression builder to try get the results
if(params["param_InvSent"] == 1) {
"Yes";
} else {
"No";
}
This gave me 2 no options, i changed it to 1 '=' and this gave me 2 yes options
I have also tried
if(dataSetRow["isdocumentsent"] == 1) {
return "Yes";
} else {
return "No";
}
This gave me no options
I have been putting this in the expression builder on the param itself, is that the correct place for it?
Your help is appreciated.
Thanks.
|
|
|
|
Re: Change display text on parameter [message #1843047 is a reply to message #1843025] |
Tue, 13 July 2021 02:59   |
Eclipse User |
|
|
|
your combo box looks fine. You want the value to be 0 or 1 because that is what the database uses and will filter on. When the combo box is being displayed for parameter entry, you should see Yes/No.
On the dataset, you will do something like
select blah from blat where isdocumentsent = ?
then select your parameter in the dataset parameters tab.
When you display this data, e.g. using a table, you can you use the map property tab on the data field. Select the data field on the table for isdocumentsent that usually says 1 or 0, then in the property editor section, select the map tab, then you can set Yes for condition row["isdocumentsent"] = 1, and No for 0.
You should not have to resort to any such code, you should remove it.
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07139 seconds