Home
Analytics
Refresh table on click of button
RepBIRT
Hi,
The report have a drop down(country names) and a button .Once the country name in the dropdown is selected and on click of the button, report should be regenerated based on the country name.
Kindly provide some references or code.
Find more posts tagged with
Comments
mwilliams
So, you have a listing report with a HTML list box and a submit button that are created in a text box with HTML. When you select a country and hit submit, you want the current report to reload with the new parameter value? Is this correct? Also, what is your BIRT version. Let me know.
RepBIRT
yes, you are right. The birt version is 3.7.
mwilliams
This report shows how to refresh a report by selecting a country from a drop down in the report. The drop down is populated with an array that is populated in the onFetch script of the parameter data set. In a text box that is bound to the parameter dataSet, a script function is created to run the report with the passed in parameter value for country. The list box is created below the script. The list is filled using the array from above. The current value for "Country" is made to be the default value so that the onChange event can be used. If another value is selected, the script function is called and the report is rerun with the new value. Hope this helps. Let me know if you have questions.
Be sure to change the URL in the script function to match the URL that runs your report. The URL is very long since I ran it from the designer. If deploying, it can be shorter.
RepBIRT
Michael,
On change of the drop down, you are calling the URL. The report is deployed in some server and you are calling the report using the URL or calling the report in the BIRT designer?
Could you kindly tell how to call the report again from the same report using script or if any in the report designer, like the one you have attached. Because the URL you are calling in the attachment is not clear enough.
mwilliams
The URL I put in the report attached above what the URL that the designer uses to run the report, which is why it's so long. If you deploy the report, your URL would be like any other deployed report's URL:
"
http://localhost:8080/birtViewer/frameset?__report=myReport.rptdesign&myParameter="
;
Then, you'd just append the value that was selected from the dropdown onto the end of this URL and you'd get your report with the new parameter passed.
If you want the above report to work correctly in your designer. Go to Window -> Preferences -> Report Design ->Preview and select to use external browsers. Now, run the report and copy the URL that is used to run your report in the browser. Replace the URL, except for the parameter name at the end, with your URL and the report should work for you.