I am having trouble altering a report in birt to meet my teams specifications.
The problem is this: I am generating a report from a jdbc datasource. I am selecting items from the DB such that there is either one row or none. If there is a row returned, I show data reflecting the results. If there is no row returned though, I should hide the entire grid that the data should have been shown in and show a simple message, "no data can be found."
I have tried different actions like adding a count to the query and the computed count from the plugin, but if no results are given then there is no count to go off of. I have also tried creating a boolean parameter showHideData that is defaulted to true and if one of the key fields is null, then showHideData is set to false. This looked as such (I placed it in the datasets afterClose script option):
if(row["FIRM"] != null){
params["showHideData"] = true;
}else {
params["showHideData"] = false;
}
This unfortunately gives me a javascript error saying that it cannot access the null value. I am not sure how to do this because I am not well versed in Javascript, but I would appreciate any help you could give.