Wednesday, May 27, 2009

Change Page Layout

Been busy writing reports lately, but I thought that I would try to publish a few quick tips that I have turned up.

One of the issues I have faced is that when a report is being formatted for PDF layout, I want it to be constrained to the page dimensions and to have it in portrait style. At the same time, when it is displayed for HTML, I want to have it in Landscape mode since the rendering seems to be better for HTML.

This little section of script placed in the beforeFactory method of the ReportItem will do that for you.

var renderO = reportContext.getRenderOption().getOutputFormat();
// change layout
if (renderO == "pdf"){
    reportContext.getDesignHandle().getMasterPages().get(0).setProperty("orientation","portrait");
} else if (renderO == "html")
    reportContext.getDesignHandle().getMasterPages().get(0).setProperty("orientation","landscape");


Monday, May 18, 2009

BIRT 2.5 M7 New and Notable

BIRT 2.5 M7 was released earlier this month. This milestone adds features like, default parameter value scripting, the ability to paste HTML and RTF directly into a Text element, and independent Locale formatting. Crosstabs have also been improved to support dragging attributes directly from the data cube into the crosstab, independent visibility for a measure and its totals, and improved support for empty values associated with a time dimension. In addition a new interface is provided that allows your Java programs to track the progress of a BIRT report.



To read more about the new features, go here. As always we appreciate feedback on the new features.