How to change Master Page size onFetch of data set. [message #933056] |
Thu, 04 October 2012 13:39  |
Eclipse User |
|
|
|
Greetings all,
Were using BIRT 3.7.2(Eclipse), Oracle 10g, JBOSS 4.2, java 1.6
Problem: Trying to change Master Page witdh from 11in to either 20in, 30in depending on number of columns.
I have been successfull in changing size using the beforeRender event but I don't have any databack from the dataset to determine number of columns.
I tried executing the same java code on the dataset onFetch event but it has no effect on the report generation/presentation. I have to admit I am vague on what I can or cannot do on certain events because I don't have a firm understanding of them all. beforeRender event does occur before my onFetch of the dataset but the java code i'm using doesn't work at that point.
Thanks in advance to all those who comment!
Mike W.
Java code used in the beforeRender event that works:
// Control size of table and page based upon output being rendered
//
//
var roption reportContext.getRenderOption).outputFormat; // Render Option
var twidth = reportContext.getDesignHandle().getElementByID(2194).getPropertyHandle("width").value; // Table width
var pwidth = reportContext.getDesignHandle().getMasterPages().get(0).getProperty("width"); // Master Page width
// See which render type we're running for
if (roption == "xls") {
// xcell width setting
var nsize = "30in";
reportContext.getDesignHandle().getElementByID(2194).setProperty("width", "100%");
reportContext.getDesignHandle().getMasterPages().get(0).setProperty("width", nsize);
}
else {
// Standard setting..
//reportContext.getDesignHandle().getElementByID(2194).setProperty("width", "10in");
reportContext.getDesignHandle().getMasterPages().get(0).setProperty("width", "11in");
};
pwidth = reportContext.getDesignHandle().getMasterPages().get(0).getProperty("width");
//...... Ending
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.10682 seconds