How to pass custom arguments to a BIRT report via GET and POST

Birt reports can be invoked using both HTTP GET as well as HTTP POST. In dynamic reports, there may be a need to pass arguments to the report. These arguments can also be passed to the report easily over http.

Via HTTP GET
Using GET is simple and straightforward. Just append the arguments as you would to any other GET request, as a query string.

http://localhost:8080/birt/frameset?__report=test.rptdesign&mystring=Hello+World

Via HTTP POST
While GET provides a simple way to invoke the reports, the obvious pitfalls of GET request stand. This includes exposing the parameters, which could potentially be used to regenerate reports if the server is not well secured. There are other reasons why you would not want to use GET, like large payload size in arguments. In such cases, the requests can easily be sent via POST as well. If security is a concern, the entire payload could be encrypted or secured in any other standard way that you would secure your POST requests.

<HTML>
<BODY>
<SCRIPT>
function post(path, params, method) {
method = method || “post”;
var form = document.createElement(“form”);
form.setAttribute(“method”, method);
form.setAttribute(“action”, path);
for(var key in params) {
if(params.hasOwnProperty(key)) {
var hiddenField = document.createElement(“input”);
hiddenField.setAttribute(“type”, “hidden”);
hiddenField.setAttribute(“name”, key);
hiddenField.setAttribute(“value”, params[key]);
form.appendChild(hiddenField);
}
}
document.body.appendChild(form);
form.submit();
}
post(‘http://localhost:8080/birt/frameset?__report=test.rptdesign’, {sample: ‘Hello World});
</SCRIPT>
</BODY>
</HTML>

How to customize BIRT Report Viewer look and feel

Enterprise software would want to maintain look and feel of all the screens in the application. This not only adds aesthetics but may also simplify usability if designed correctly. This is all the more important if a screen has a bunch of functionality that integrates with the rest of the product.

Birt is highly extensible and just like any mature product, provides ability to customize various aspects of a report. Birt comes with a plain and simple report viewer out of the box. However, there are ways to customize this page. While one can go too far depths in customizing this page, basic requirements like matching UI template is very simple to implement in Birt.

you can customize the UI of report viewer from FramesetFragment.jsp file. On a development box with just xampp installed at default location, this file can be found at:

C:\xampp\tomcat\webapps\birt\webcontent\birt\pages\layout\FramesetFragment.jsp

In addition, you can also customize the Style.css file located at birt\styles\style.css to match your template.

For example, if you want to add your custom logo to the page or you want to add the border to your report, you will make following change to the file:

FramesetFragment

FramesetFragment