Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » PDF export of report with grid doesn't work correctly if cell is broken across two pages(PDF report shows broken grids while HTML works fine)
PDF export of report with grid doesn't work correctly if cell is broken across two pages [message #1061120] Thu, 30 May 2013 07:09 Go to next message
Bianca D. is currently offline Bianca D.Friend
Messages: 17
Registered: February 2013
Junior Member
This topic has been discussed in a thread before but due to a problem with the forum it is unaccessible now and had to be deleted. So I'll open a new thread and try to find a solution.

I'm trying to build a report that uses dynamically created grids. All created grids use rowspan to display them more nicely (the other cells are dropped correctly).

When I export the report as html, everthing looks perfect, all grids are correct. When I use the pdf export, some grids have several mistakes (rowspan to low, cells devided etc.). I tried to export again, but the report looks exactly the same, with the same broken grid.

It appears, that the grid breaks because of a grid cell that is broken across two pages (due to long cells). I tried to avoid that by setting the PageBreakInside for the cells to "avoid", but it doesn't work.

This bug first occured in version 4.2.1 but it's still the same in 4.2.2. I reported a bug a while ago, but nothing seems to happen. This bug is critical and might force me to switch to a different report engine though I really like BIRT.

Is there any way I could fix this? Currently I use the border settings to immitate the rowspan and that works ok, but doesn't look very nice if you reach the end of the page and the cell is broken to the next page.

Any ideas? I would really appreciate any help I can get!

Best regards,
Bianca

The link to the reported bug: Link
Re: PDF export of report with grid doesn't work correctly if cell is broken across two pages [message #1061266 is a reply to message #1061120] Thu, 30 May 2013 21:14 Go to previous messageGo to next message
Kristopher Clark is currently offline Kristopher ClarkFriend
Messages: 130
Registered: January 2013
Senior Member
Can you post your rptdesign or recreate this with the sample db?
Re: PDF export of report with grid doesn't work correctly if cell is broken across two pages [message #1061307 is a reply to message #1061120] Fri, 31 May 2013 06:30 Go to previous messageGo to next message
Bianca D. is currently offline Bianca D.Friend
Messages: 17
Registered: February 2013
Junior Member
Hi Kristopher,

it is an eclipse project that reads the data and creates the report. I created a version using dummy data. You can download it at:
https://www.dropbox.com/s/f4mft9ts7nv00rr/reportGenerator.zip

In com.config.HomeDirHandler you can set where the project expects the BIRT runtime [getBirtHomeDir()] and the designfile [getBirtDataDir()] to be. The reports are exported to the "BirtDataDir" as well.

Thank you for your help!
Best regards,
Bianca
Re: PDF export of report with grid doesn't work correctly if cell is broken across two pages [message #1063983 is a reply to message #1061307] Mon, 17 June 2013 06:56 Go to previous messageGo to next message
Bianca D. is currently offline Bianca D.Friend
Messages: 17
Registered: February 2013
Junior Member
Hi Kristopher,

do you have any new information about this topic? This is still a big issue for me.

Best regards,
Bianca
Re: PDF export of report with grid doesn't work correctly if cell is broken across two pages [message #1064389 is a reply to message #1063983] Wed, 19 June 2013 05:05 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Bianca,

Hopefully your bug will be dealt with soon. In the meantime, have you thought of trying the same by putting your data into a dataSet and using a table to see if you can get better results or even trying to build the table using HTML in a HTML text box as a workaround? I know these aren't ideal solutions, but they might be something to try until something is worked out with the bug. Also, you could try a stable build of the 4.3 release, which is scheduled to release next week. It's likely no different since it's not noted in the bug, but you never know!


Michael

Developer Evangelist, Silanis
Re: PDF export of report with grid doesn't work correctly if cell is broken across two pages [message #1064611 is a reply to message #1064389] Thu, 20 June 2013 08:53 Go to previous messageGo to next message
Bianca D. is currently offline Bianca D.Friend
Messages: 17
Registered: February 2013
Junior Member
Hi Michael,

I didn't try to use data sets. Is there any documentation or example code on how to do that? I have to do it in Java because I have to retrieve the data from the system first.

I did try an earlier version of 4.3 and the bug still occurs.

I had another idea. Maybe it is possible to check whether a row fits to the same page or not before adding it to the grid and insert a page break before if it doesn't (or split the row in two separate rows). I'm not sure how to do that yet but it could be a good solution. Have you ever done something like that?

Best regards,
Bianca
Re: PDF export of report with grid doesn't work correctly if cell is broken across two pages [message #1064785 is a reply to message #1064611] Fri, 21 June 2013 06:27 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

I've done something similar to what you're talking about. You would have to calculate the number of rows you've gone down the page as you go, then check the current row to see if it'll fit based on your calculation. I've also done something like splitting the data up into rows that work better with the page using a scripted dataSet to break up my long data. What format is the data in when you get it? From the sounds of it, you'd likely end up using a scripted dataSet. There are several examples of scripted dataSets in the BIRT Exchange devShare. Utilizing a dataSet might also allow you to use grouping rather than merging grid cells. That might fix the issue without having to do anything extra, like discussed above. Let me know if you have further questions.

Michael

Developer Evangelist, Silanis
Re: PDF export of report with grid doesn't work correctly if cell is broken across two pages [message #1064788 is a reply to message #1064785] Fri, 21 June 2013 06:50 Go to previous messageGo to next message
Bianca D. is currently offline Bianca D.Friend
Messages: 17
Registered: February 2013
Junior Member
The data is inside of java objects I get with help of my systems api. I've never worked with the BIRT scripts and I'm not sure wether I can use it in my usual workflow or not. I call the report generation from the systems web interface (jsp) and directly go inside java to fill the report with data and generate the PDF.
If i can create the data set from inside java it might work the way you descriped it. Is that possible or do I have to use the script?
Re: PDF export of report with grid doesn't work correctly if cell is broken across two pages [message #1065662 is a reply to message #1064788] Thu, 27 June 2013 05:06 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Sorry for the delay. Yes, you can create the dataSet in Java. You can use the DEAPI to modify your report.

Michael

Developer Evangelist, Silanis
Re: PDF export of report with grid doesn't work correctly if cell is broken across two pages [message #1065901 is a reply to message #1065662] Fri, 28 June 2013 08:15 Go to previous messageGo to next message
Bianca D. is currently offline Bianca D.Friend
Messages: 17
Registered: February 2013
Junior Member
I started looking into data sets. What I need is a table containing 3 columns (like in the picture I attached). But the rows aren't normal string arrays. One element in the first row can belong to a list of elements in the second. It's the same with elements in the second and third column. Is that even possible to create as a data set? I don't want to create a new row with empty columns.

I've worked with the DEAPI before. It's only the data set part that I'm new to.
  • Attachment: Table.PNG
    (Size: 56.49KB, Downloaded 297 times)
Re: PDF export of report with grid doesn't work correctly if cell is broken across two pages [message #1067071 is a reply to message #1065901] Fri, 05 July 2013 16:35 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

No, you wouldn't want to create a dataSet with empty columns. What you'd do would be to make a dataSet like:

Col1 | Col2 | Col3
Data1 | Part3 | Detail1
Data1 | Part3 | Detail2
...
Data1 | Part1 | Detail1
...
etc.

Then, you'd use grouping in your table to get what you're wanting for the layout.


Michael

Developer Evangelist, Silanis
Re: PDF export of report with grid doesn't work correctly if cell is broken across two pages [message #1067431 is a reply to message #1067071] Mon, 08 July 2013 15:57 Go to previous messageGo to next message
Bianca D. is currently offline Bianca D.Friend
Messages: 17
Registered: February 2013
Junior Member
Thanks again, Michael! I will have a deeper look into it tomorrow and report back whether it works or not.
Re: PDF export of report with grid doesn't work correctly if cell is broken across two pages [message #1068292 is a reply to message #1067431] Fri, 12 July 2013 22:31 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Sounds good. Let me know.

Michael

Developer Evangelist, Silanis
Re: PDF export of report with grid doesn't work correctly if cell is broken across two pages [message #1070528 is a reply to message #1068292] Thu, 18 July 2013 06:38 Go to previous messageGo to next message
Bianca D. is currently offline Bianca D.Friend
Messages: 17
Registered: February 2013
Junior Member
Sorry for answering that late, I have been sick for over a week. I started playing around with data sets and groups though, but couldn't get the result I was hoping for. Is there a way to create the layout I posted as a picture before? I don't want the group header to be in a separate line and I don't want the data, that is used for grouping, to be repeated in each line.

Grouping in general worked, only the layout isn't the way I want it to be. Thank you for your help!
Re: PDF export of report with grid doesn't work correctly if cell is broken across two pages [message #1071392 is a reply to message #1070528] Sat, 20 July 2013 01:32 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

You can use the drop on the group cell to get it to drop down to the detail level. To set this, choose the cell that the group data element is in and set the drop property on the general tab of the property editor to "detail".

Michael

Developer Evangelist, Silanis
Re: PDF export of report with grid doesn't work correctly if cell is broken across two pages [message #1072196 is a reply to message #1071392] Mon, 22 July 2013 09:14 Go to previous messageGo to next message
Bianca D. is currently offline Bianca D.Friend
Messages: 17
Registered: February 2013
Junior Member
Ahh, ok. It works that way, but I came across another bug. It's been reported almost 2 years ago but wasn't fixed by now. Without that bug, the tables would provide exactly the functionality I'm looking for: grouping the data and if it's not possible to fit everything on one page, use a page break and repeat the header. But as long as the tables are kind of broken/odd looking, I can't really work with them.

I found a way to avoid the super long cells that caused the page break and therefor the occurrence of my initial bug, but it's still possible to occur with a lot of data. I will try to add the manual page break you mentioned earlier, so hopefully I can avoid this bug from occurring even with more data. That's pretty much all I can do for now. I still hope that one of the bugs (or both) is getting fixed eventually so I don't have to use workarounds. If you hear anything about that please let me know!

So far thank you so much for your help! I wouldn't have been able to fix that without you!

Best regards,
Bianca
Re: PDF export of report with grid doesn't work correctly if cell is broken across two pages [message #1072407 is a reply to message #1072196] Mon, 22 July 2013 17:37 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

You're very welcome. On the old bug, if you've got votes left to have it be a bug of interest, I'd vote for it and maybe add a comment if you haven't already. Hopefully one will be fixed for you sometime soon!

Michael

Developer Evangelist, Silanis
Re: PDF export of report with grid doesn't work correctly if cell is broken across two pages [message #1072603 is a reply to message #1072407] Tue, 23 July 2013 06:15 Go to previous message
Bianca D. is currently offline Bianca D.Friend
Messages: 17
Registered: February 2013
Junior Member
I did vote for it already and just added a comment. Thanks!
Previous Topic:Getting values from other datasets
Next Topic:[SOLVED] Computing between data from the same column
Goto Forum:
  


Current Time: Thu Mar 28 19:01:21 GMT 2024

Powered by FUDForum. Page generated in 0.03168 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top