Home
Analytics
table not fitting to page
roslyn
Hi,
Is there a solution to fix the table height, I tried using break intervals but when table has less rows the table is not extending whole page (table ends at half of the page) where I want the table to fit the whole page.
I followed the examples in forum but it dint work. Is there any solution in 2.6.1 .
Find more posts tagged with
Comments
mwilliams
Hi savi,
Do you have a fixed row height? Or do your rows vary in height? If fixed, there are a couple different options. One would be to use extra footer rows that you would change the visibility setting of each extra row depending on how many rows you had on your last page. Another would be something like in the devShare entry below:
http://www.birt-exchange.org/org/devshare/designing-birt-reports/989-extend-table-to-fit-page/
roslin
Hi williams,
Thank you for your reply.
I have tried that example, when the particular row has multiple lines it fails. The page shrinks when the row lines cannot accommodate to the current page and when the last pages has no rows to display. We want the table to fit page if it has less or more lines or no lines.
attached is the output..
Thanks,
Roslin
mwilliams
Without your row height being fixed, you'll have to do a lot more work to push the footer down. You'll have to write script to track how many lines your rows take up by estimating by characters or something along those lines. Then you could do something similar to the example linked above to push the footer to the bottom. Hope this helps! I can try to make an example if you're unable to get something like this working.
roslin
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="74189" data-time="1299083323" data-date="02 March 2011 - 09:28 AM"><p>
Without your row height being fixed, you'll have to do a lot more work to push the footer down. You'll have to write script to track how many lines your rows take up by estimating by characters or something along those lines. Then you could do something similar to the example linked above to push the footer to the bottom. Hope this helps! I can try to make an example if you're unable to get something like this working.<br /></p></blockquote>
<br />
Attached is my sample report and xml.It would be great if you could please help me.
mwilliams
What is your BIRT version? I'll try to get you started in the right direction.
roslin
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="74262" data-time="1299166140" data-date="03 March 2011 - 08:29 AM"><p>
What is your BIRT version? I'll try to get you started in the right direction.<br /></p></blockquote>
<br />
We recently upgraded it to BIRT 2.6.2
mwilliams
Is this how your report will be set up? With the long text column only getting a short width? This causes issues with pushing the footer down because BIRT doesn't want to split up a single row. It would be pretty messy making something like this work, I think. I think if you kept a running track of lines per page, you could have a second detail row that you could hide or show depending on your rowCount total, but like I said, this starts to get pretty messy. I'll work at it a bit and see if I can come up with a simple example. You might try it out too. Let me know if my idea isn't very clear, which I'm sure it isn't.
roslin
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="74341" data-time="1299292427" data-date="04 March 2011 - 07:33 PM"><p>
Is this how your report will be set up? With the long text column only getting a short width? This causes issues with pushing the footer down because BIRT doesn't want to split up a single row. It would be pretty messy making something like this work, I think. I think if you kept a running track of lines per page, you could have a second detail row that you could hide or show depending on your rowCount total, but like I said, this starts to get pretty messy. I'll work at it a bit and see if I can come up with a simple example. You might try it out too. Let me know if my idea isn't very clear, which I'm sure it isn't.
<br /></p></blockquote>
<br />
<br />
Micheal,<br />
<br />
Yes, we are in the same page. Here we have to consider one thing, the text column may or may not have data. So we have taken row count on line number and applied page break after 10 rows, but when we have large data in text column the line break scenario is failing. My considerations like.<br />
<br />
1. Can we count blank rows in line number column?<br />
2. Can we apply page break based on page number?<br />
3. Can we consider the total row count in table?<br />
<br />
We are trying with the below link to find the number of characters in the page, but we are not aware of the Scripting in BIRT,cos we are basically from Oracle background. However in my report the first page consists of low number of chars because it includes header part,from the second page onwards we have full page. I think the scenario will not work with my requirement. <br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/org/forum/index.php/topic/20362-extend-tablegrid-to-fit-page-for-different-row-height/page__s__d876abd7924a3e5f7942a56a13c33a23'>http://www.birt-exchange.org/org/forum/index.php/topic/20362-extend-tablegrid-to-fit-page-for-different-row-height/page__s__d876abd7924a3e5f7942a56a13c33a23</a><br
/>
<br />
Please drop your views on the same and provide the sample, mean while i will work on your approach.<br />
<br />
Thanks,<br />
Roslin
mwilliams
Roslin,
If you're counting characters to make a guesstimation on lines, if there were no data it wouldn't count any rows. So, we could handle this by adding 1 if there were no characters in that column but the other columns were still filled.
Not sure on your #3 above. The total row count in the table that you could figure out would be rows, not lines. If there are 3 lines in a single row, your row count would still call it 1.
The extra row that pushes the table to the bottom would actually need to be above the actual detail row so that you can have access to the next data to be displayed when you are needing to push the table to the bottom and manual page break. If you put it after the actual detail row, it'd be too late.
Give this a try and let me know. If you can't get it, I'll work on putting something together to see if I can get it.
roslin
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="74408" data-time="1299541506" data-date="07 March 2011 - 04:45 PM"><p>
Roslin,<br />
<br />
If you're counting characters to make a guesstimation on lines, if there were no data it wouldn't count any rows. So, we could handle this by adding 1 if there were no characters in that column but the other columns were still filled.<br />
<br />
Not sure on your #3 above. The total row count in the table that you could figure out would be rows, not lines. If there are 3 lines in a single row, your row count would still call it 1.<br />
<br />
The extra row that pushes the table to the bottom would actually need to be above the actual detail row so that you can have access to the next data to be displayed when you are needing to push the table to the bottom and manual page break. If you put it after the actual detail row, it'd be too late.<br />
<br />
Give this a try and let me know. If you can't get it, I'll work on putting something together to see if I can get it.<br /></p></blockquote>
<br />
<br />
Williams,<br />
<br />
Appreciated your suggestion. We thought that if we could cont the no lines in the table(say 10 then pagBreak) then it is easy to achieve my issue. Could you please drop one example on your thoughts.<br />
<br />
Thanks,
mwilliams
Let me make sure I'm understanding correctly, you want to just show 10 lines on a page, then pagebreak? If this is what you're wanting to do, that'd be difficult with your data since you have rows with well over 10 lines that you can't force a page break during. Let me know.
roslin
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="74457" data-time="1299616894" data-date="08 March 2011 - 01:41 PM"><p>
Let me make sure I'm understanding correctly, you want to just show 10 lines on a page, then pagebreak? If this is what you're wanting to do, that'd be difficult with your data since you have rows with well over 10 lines that you can't force a page break during. Let me know.<br /></p></blockquote>
<br />
<br />
Yes, Exactly we are in the same page. I want to break at 10 lines and apply second master page. Please provide me a example report.
mwilliams
You cannot currently apply a second master page to a single element. You'd have to create two tables, one that showed the first 10 lines only, then another that showed the rest of the lines and attach the different master pages to them.
roslin
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="74486" data-time="1299682532" data-date="09 March 2011 - 07:55 AM"><p>
You cannot currently apply a second master page to a single element. You'd have to create two tables, one that showed the first 10 lines only, then another that showed the rest of the lines and attach the different master pages to them.<br /></p></blockquote>
<br />
Yes exactly,Could you please give me an example report for this scenario.
mwilliams
Here is a quick simple example showing how to split a "single table" over two master pages.
roslin
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="74533" data-time="1299775782" data-date="10 March 2011 - 09:49 AM"><p>
Here is a quick simple example showing how to split a "single table" over two master pages.<br /></p></blockquote>
<br />
<br />
Thank you very much..
roslin
Hi williams,
I have a problem with multi-line pagebreak, say if a last row has large lines of description and even though the page can accommodate half of it the entire row breaks to the next page. Can we print the lines that can fit in current page and rest of the lines in next page cos the complete row printing in the next page leaves the current page blank. Could you Please suggest me.
mwilliams
Are you setting "avoid" on the page break inside for the row that contains this multi line element?
I know I've seen a little buggy behavior that even if it's set to auto, it's still avoiding. If you select "avoid", save, then select "auto" again and save, it seemed to work correctly.
roslin
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="74676" data-time="1300199097" data-date="15 March 2011 - 07:24 AM"><p>
Are you setting "avoid" on the page break inside for the row that contains this multi line element?<br />
<br />
I know I've seen a little buggy behavior that even if it's set to auto, it's still avoiding. If you select "avoid", save, then select "auto" again and save, it seemed to work correctly.<br /></p></blockquote>
<br />
Yep,it worked.
roslin
<blockquote class='ipsBlockquote' data-author="'roslin'" data-cid="74765" data-time="1300352679" data-date="17 March 2011 - 02:04 AM"><p>
Yep,it worked.<br /></p></blockquote>
<br />
Can you please give me examples on the table to fit the page, I have tried inserting the footers it doesn't work and extend table of it page (<a class='bbc_url' href='
http://www.birt-exchange.org/org/devshare/designing-birt-reports/989-extend-table-to-fit-page/'>http://www.birt-exchange.org/org/devshare/designing-birt-reports/989-extend-table-to-fit-page/</a>)
is good example it works when the pages has maximum rows. The problem repeats when it has less rows. Can we onRender event and set page size to the height.<br />
<br />
This is the only issue i have now.. please kindly drop your thoughts..
mwilliams
Try looking at this example to help with finding the rows per page. From this, you should be able to use the second detail row idea to add the extra lines to push the page to the bottom like we talked about. Let me know if you have questions.
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1336-manual-page-breaks-for-multi-line-rows/
roslin
Hi Williams,
I have tried this example its working fine for first four pages and fails for the next pages.
Please find the attached output..
mwilliams
Did you try to extend the page or is this just trying to do exactly like the example I posted?
roslin
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="74813" data-time="1300459013" data-date="18 March 2011 - 07:36 AM"><p>
Did you try to extend the page or is this just trying to do exactly like the example I posted?<br /></p></blockquote>
<br />
Sorry If I went wrong any where, I have used extend table to fit page logic (<a class='bbc_url' href='
http://www.birt-exchange.org/org/devshare/designing-birt-reports/989-extend-table-to-fit-page/'>http://www.birt-exchange.org/org/devshare/designing-birt-reports/989-extend-table-to-fit-page/</a>)
, used lineCount logic and I haven't used reportContext.getPersistentGlobalVariable logic. Please suggest me on this.
mwilliams
Ok, so you tried to extend the table to fit the page too. Did you change your row length values so that the script counts lines for your report or did you leave the number the same as was in mine? Can you recreate what you're trying to do to extend the table on the example that I posted so that I can run it? Thanks!
roslin
Hi Williams,
I have tried the example with and without extendTable. I have tried lineCount concept on my report but the table int fit to page so I applied extendTable to extend the table to page. I am not sure if I have used this logic correctly.
Please correct me where I went wrong.
Thanks,
mwilliams
Here is an example showing how you'll have to implement this. I have put a border around the extended portion just to show it is there. Because of the guestimation of line count, there are some variances where the guestimate of lines is off by a couple, but it'll be close if your extimated characters per line is good. There is code in the visibility expression for the detail row with the "extension" textbox in it. There is also code in the onCreate of the second detail row and code in both text boxes to build the extensions. Let me know if you have questions.
roslin
Hi Williams,
I have given the lineCount2 and rowCount as 42. My page 4 & last page has problem, is it because of the my bad guesstimation of the Count? Please find the attached output.
Thanks in advance...
mwilliams
Can you attach the report design so I can see how you did everything?
roslin
Hi Williams,
Attached is my report.
Thanks,