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)
Character truncation when exporting as PDF with ViewerServlet
Pippo
I'm currently using the ViewerServlet to generate BIRT reports and some characters will be truncated if the data is too long when exporting the report in PDF format.
I also did some readings, and found that it may help to set the PDF_HYPHENATION and PDF_TEXT_WRAPPING option as true. However, it seems that it doen't take affect when I add following lines in beforeRender method of the report design.
reportContext.getRenderOption().setOption(IPDFRenderOption.PDF_HYPHENATION, Boolean.True);
reportContext.getRenderOption().setOption(IPDFRenderOption.PDF_TEXT_WRAPPING, Boolean.True);
Can anyone help? Any suggestions will be highly appreciated. Thanks.
Find more posts tagged with
Comments
mwilliams
Hi Pippo,
Can you recreate your issue with the sample database so I have a report to work with that has the issue? Also, what version of BIRT are you using?
Pippo
Thanks Michael.
I'm using BIRT 2.3.2 and here's a very simple report I'm using. It displays customer info while some columns may contain many characters.
I am now using BIRT viewer for report rendering ,and now the problem is when we export these report as PDF with BIRT viewer, I found some characters are truncated in those columns which contain long data. I try to solve it with BIRT scripting which I mentioned in the original post but it seems that it doesn't take affect. Could you please help to look at the issue? Thank you very much.
A sample BIRT design is in the attach, and here are the SQLs I used to create the sample database:
=========================================================
create table customer (customer varchar(20), address varchar(255), phone varchar(50))
insert into customer VALUES ('CustomerA', 'FLOOR 10, BUILDING 10, ZHONGGUANCUN SOFTWARE SOFTWARE PARK, NO.8, DONGBEIWANG ROAD, SHANGDI STREET, HAIDIAN DISTRICT, BEIJING, CHINA', '8610-2324144')
insert into customer VALUES ('CustomerB', 'FLOOR 10, BUILDING 10, ZHONGGUANCUN SOFTWARE SOFTWARE PARK, NO.8, DONGBEIWANG ROAD, SHANGDI__LONG_LONG_LONG_LONG_LONG STREET, HAIDIAN DISTRICT, BEIJING, CHINA', '8610-2324144')
insert into customer VALUES ('CustomerC', 'FLOOR 10, BUILDING 10, ZHONGGUANCUN_LONG_LONG_LONG_LONG_LONG_LONGSOFTWARE SOFTWARE__LONG_LONG_LONG_LONG_LONG PARK, NO.8, DONGBEIWANG__LONG_LONG_LONG_LONG_LONG ROAD, SHANGDI__LONG_LONG_LONG_LONG_LONG STREET, HAIDIAN_LONG_LONG_LONG_LONG_LONG_LONG DISTRICT, BEIJING, CHINA', '8610-2324144')
=========================================================
mwilliams
Pippo,
I know one thing that you could do would be to use substrings of your long text and split it up so the auto wrap works.
Pippo
Thanks Michael.
I think that would be a possible solution.
mwilliams
Pippo,
Alright, let me know if it works for you.