Report Width Formatting Question [message #674606] |
Fri, 27 May 2011 14:28 |
No real name Messages: 4 Registered: May 2011 |
Junior Member |
|
|
Hello,
I have created a report in BIRT using a Scripted Data Source built into an accounting application. The user can customize the report in a GUI dragging and dropping categories into the desired location. The report can have up to 14 columns horizontally, and 4 rows, the columns that do not have information in them are hidden in the rendering of the report.
I would like to generate a report with fixed column widths of about 1.5 inches, but a report width to reflect the number of columns that are appearing, so in short, a way to customize the report width on the fly each time it is ran - say a calculated width of 1.5in * # of columns.
I created a custom master page of 21 (1.5in * 14 columns) inches, set the "Layout Preference" of the report to "Auto Layout", and the width of each column to 1.5 inches. What happens here is that the "Auto Format" seems to override the column widths, if the data in a column of a relatively long label such as "Foreign Address" is empty, the column is much narrower than 1.5 inches, and the label is squished to take up 2 lines instead of 1. However the "Auto Layout" seems to help the report width situation. Now the "Fixed Layout" does what I want it to do with the column widths, they are each 1.5 and do not get squished when there is no data in that column, but the report width will be 21 inches even when only a few columns are showing up, which looks goofy. I have tried setting the individual columns "Shrink" variable to false (found in the "Advanced" section of the "Properties" tab), but that does not stop the columns from shrinking when I choose "Auto Layout".
Is there a way I can keep each column width to 1.5 inches and have a report width of varying length depending on how many columns are showing in the report?
Note:
I am generating reports of type HTML.
Also another question - is there a way to generate pdf reports with widths of multiple pages?
Thanks,
Meredith
|
|
|
Re: Report Width Formatting Question [message #675486 is a reply to message #674606] |
Tue, 31 May 2011 16:00 |
|
Meredith,
In the beforeFactory you should be able to get a handle on the table if
you name it in its general properties. With this handle you should be
able to set individual column widths:
var mytbl = reportContext.getDesignHandle().findElement("mytable");
var col = mytbl.getColumns().get(0);
col.setProperty("width", "6in");
You should also be able to set properties for the master page:
reportContext.getDesignHandle().findMasterPage("myMasterPage").setProperty("width",
"8in");
Jason
On 5/27/2011 10:28 AM, forums-noreply@eclipse.org wrote:
> Hello,
>
> I have created a report in BIRT using a Scripted Data Source built into
> an accounting application. The user can customize the report in a GUI
> dragging and dropping categories into the desired location. The report
> can have up to 14 columns horizontally, and 4 rows, the columns that do
> not have information in them are hidden in the rendering of the report.
> I would like to generate a report with fixed column widths of about 1.5
> inches, but a report width to reflect the number of columns that are
> appearing, so in short, a way to customize the report width on the fly
> each time it is ran - say a calculated width of 1.5in * # of columns.
> I created a custom master page of 21 (1.5in * 14 columns) inches, set
> the "Layout Preference" of the report to "Auto Layout", and the width of
> each column to 1.5 inches. What happens here is that the "Auto Format"
> seems to override the column widths, if the data in a column of a
> relatively long label such as "Foreign Address" is empty, the column is
> much narrower than 1.5 inches, and the label is squished to take up 2
> lines instead of 1. However the "Auto Layout" seems to help the report
> width situation. Now the "Fixed Layout" does what I want it to do with
> the column widths, they are each 1.5 and do not get squished when there
> is no data in that column, but the report width will be 21 inches even
> when only a few columns are showing up, which looks goofy. I have tried
> setting the individual columns "Shrink" variable to false (found in the
> "Advanced" section of the "Properties" tab), but that does not stop the
> columns from shrinking when I choose "Auto Layout". Is there a way I can
> keep each column width to 1.5 inches and have a report width of varying
> length depending on how many columns are showing in the report?
> Note:
> I am generating reports of type HTML.
> Also another question - is there a way to generate pdf reports with
> widths of multiple pages?
>
> Thanks,
> Meredith
|
|
|
|
Powered by
FUDForum. Page generated in 0.02892 seconds