Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Setting page height equal to a table's height
YvanHurtad
Hello, BIRT designers<br />
<br />
<strong class='bbc'>I'll first explain my situation:</strong><br />
I'm using the tribix XLS emitter because I needed multi-sheet support, but I had trouble with pagination, since the tribix emitter jumps to a new sheet everytime the the page fills ignoring page-breaks set in the design(it stills execute them though, leaving somes pages half blank, making the jump after the page ends always) I discover that the page size that tribix uses is the same the MastePage has in the design. In my design I have a table with a dataset that returns some thousand rows wich I need to show in a single sheet and another table to be shown in a separate sheet. I enabled the "&__export_single_sheet=true" in my url, but there's no way of then making another sheet with the other table.<br />
<br />
<em class='bbc'>What I really need is complete control over pagination and how much is shown in a single sheet in the XLS output</em><br />
<br />
I came up with the idea of making the masterpage Hight huge (1000 in) since is the property that regulates sheet jumps in the tribix xls emitter, but the output ends up with a bunch of blank space, and I dont like it.(the remove_empty_rows variable of tribix doesn't fix this)<br />
<br />
<br />
<span class='bbc_underline'><strong class='bbc'>The real question:</strong></span><br />
<br />
Is it possible to make the master page height equal to a table's height after filling it with the dataset?<br />
<br />
That way the tribix emitter would make a jump to a new sheet when the table ends. <br />
<br />
I know the masterpage properties can be modified through scripts but I wouldn't know how to do it and don't know either if it's height could be set equal to a filled-with-dataset-table.<br />
<br />
How would this script be? during which fase should it be implemented(onPagestart, etc)? in which object should this script be? I have no idea (=<br />
<br />
<strong class='bbc'>Any thoughts, recomendations, or guidance would be much appreciate it!</strong><br />
<br />
Regards,<br />
Yvan
Find more posts tagged with
Comments
mwilliams
Hi Yvan,
I'm not certain how setting a page break interval of 0 works for the multiple sheet feature of the Tribix emitter, but have you tried setting the page break interval to 0 for the first table and then setting a page break between the tables so that the second table does go to a new sheet? This is just an idea. Let me know.
YvanHurtad
I need to dynamically set my master page height property. I know this can be done trought scripting. <br />
<br />
I found this example ---> <a class='bbc_url' href='
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1246-set-master-page-properties-using-script/'>http://www.birt-exchange.org/org/devshare/designing-birt-reports/1246-set-master-page-properties-using-script/</a>
; <br />
(the script sets the pagetype through a parameter, and in commented lines, shows how to manipulate some other properties in beforeFactory)<br />
<br />
I want to change the page hight though, and can't find the way.<br />
<br />
More so, I want it to be equal to the hight of a table after is filled with the dataset. I really dont know how to do this.<br />
after watching this ---> <a class='bbc_url' href='
http://www.eclipse.org/birt/phoenix/deploy/reportScripting.php'>http://www.eclipse.org/birt/phoenix/deploy/reportScripting.php</a><br
/>
<br />
I came up with this idea:<br />
1.- declare a global varible 'TableHeight' and fill it with the table height property in the afterClose event of the data set (this could be done in the afterFactory at report level too, I belive) Someting like this: <br />
<br />
<em class='bbc'>reportContext.setPersistentGlobalVariable("TableHeight",reportContext.getDesignHandle().findElement("tabla").getProperty("height"))</em><br />
<br />
<br />
2.- in the afterFactory, set the masterpage hight equal to TableHeight. Like this:<br />
<em class='bbc'><br />
reportContext.getDesignHandle().findMasterPage("myMasterPage").setProperty("Hight",reportContext.getPersistentGlobalVariable("TableHeight"))</em><br />
<br />
<br />
I tried this and it didn't work of course.<br />
Could anyone give me some guidance on how to achieve this? or perphaps tell me what else is there that could be done instead.<br />
<br />
Thanks in advance!
YvanHurtad
Hello, Michael, thanks for your response.<br />
<br />
Yes, I tried that and it didn't work. Tribix does makes a new sheet with each page break, but it does so with each page that fills too.<br />
<br />
To give you and example: <br />
I have a table with 50 rows and page break set to 40. The first 39 rows fills the first Letter-size page, then 1 row in the next sheet, then makes the page-break jump to another sheet with the rest of the rows (10) That's not the problem, as it seems to be how it works. <br />
<br />
I'm trying to find a way to manipulate this in the emitter itself, but meanwhile I thought about trying to solve it with BIRT too and this was the best idea I came up with (dynamic page height).<br />
<br />
I posted another topic being more specific on the matter<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/org/forum/index.php/topic/21953-dynamic-master-page-height-with-script/'>http://www.birt-exchange.org/org/forum/index.php/topic/21953-dynamic-master-page-height-with-script/</a>
;
mwilliams
I'm not sure that it can be done like that, but when you tried setting your masterpage height, did you have the "type" in your property editor of your masterpage set to "custom"? Otherwise the height is probably fixed due to the selection of a certain page type.
YvanHurtad
Hi, Mike.
Yes, the page type was set to custom, no luck.
In which phase are the data sets executed? In order to set the page height from a row in a data set (say, a count)
Thanks, again!
mwilliams
This should help you out with the event order:
http://www.eclipse.org/birt/phoenix/deploy/reportScripting.php