2005 IR Help Posted August 23, 2006 Share Posted August 23, 2006 By: Tony Cheng - spcheng7 Problem when output to HTML 2004-03-03 02:59 I have a report which contains a table. There are five columns inside the table. The string inside the cell would be much longer than the width of each cell. My problem is : I have already set stretchType="RelativeToTallestObject". It is prefect when I output a PDF file. All the text would be wrapped and it looks great. But when I output a HTML file, the cell would expand and make the table expand too. How can I solve this problem in order to make the HTML would wrap the text just like PDF file ? Thank you. By: Teodor Danciu - teodord RE: Problem when output to HTML 2004-03-07 06:12 Hi, The problem is that HTML content will never render exactly like PDF. This is obvious when it comes to text wrapping. If you have a long word, it will wrap OK in PDF, but in HTML it won't wrap and rather force the width of the table cell. This is probably why PDF is a "Portable Document Format" and HTML is not. I hope this helps. Teodor By: Tony Cheng - spcheng7 RE: Problem when output to HTML 2004-03-07 19:49 Hi Teodor, Thx for your reply. But, does u mean that this problem cannot be solved ? Actually I have tried to modify the "fonts" sample' html in the jasperreports-0.5.2-projectjasperreportsdemosamplesfonts. If I increase the length of text, the text can be wrapped. I have noticed that the html which text cannot be wrapped used "colspan" in the <td> of the table cell. I want to ask whether I can tell jasperreport not to use colspan ? Thank you for your help Tony By: David Lim - aberrant80 RE: Problem when output to HTML 2004-03-07 22:38 If you look at the JRHtmlExporter class, you'll notice that it's quite impossible to set that. Given that JasperReports is aimed at producing reports in multiple formats, it's actually not very logical or easy to give much customisation options for just one of the formats. You could try to delve into the source code and derive something that does what you want though. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now