Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

In BIRT report, how to throw error when mandatory fields are not filled

Hi,
I have 6 mandatory fields as input for a BIRT Report. If I do not select any value for any of these fields and try to run the report, it shows Loading.... How to throw an error if any of these fields are not filled.

0 votes

Comments

I have to validate 2 date fields and 4 List boxes (cascading parameters).

When I click on each of the parameter and wrote below code in validate of script tab, it did not work

if(params["Start Date"].value == null){
false;
}
else {
true;
}



One answer

Permanent link
How about this.
1. Make all your parameters non-mandatory.
2. Add a dynamic text in the beginning of report with logic something like this
if (params["param1"].value == null ) "No Param1 provided";
You may format the test in red.
3. Set the visibility of this text using 'visibility' property and provide an expression like
if (params["param1"].value == null )
false;
 else  true;

0 votes

Comments

Thanks Ankur for replying.
I think, this is the best work around for this problem.

But, when I make all the parameters non-mandatory, the report runs automatically for the first time. Is there any way to stop rendering the report for the first time and show the report parameters.

With this solution, as soon as you click on the report, it shows "No param1 is provided". But, we have not given a chance for the user to select the parameter. So, it should first ask to enter the parameter and if the user has not given any input, then this error should come up.

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,019

Question asked: Jul 24 '13, 10:40 p.m.

Question was seen: 7,974 times

Last updated: Jul 25 '13, 7:05 a.m.

Confirmation Cancel Confirm