Community
Participate
Working Groups
Build Identifier: 20090920-1017 I have created html table for my requirement like, if(HTMLCommentsList.length>0){ HTMLCommentsList = HTMLCommentsList + "<table border= '1' WIDTH='100%'><tr><td WIDTH='10%'>"+row["ORDERNUMBER"]+"</td>"+ "<td WIDTH='90%'>"+row["COMMENTS"]+"</td></tr></table>"; }else{ HTMLCommentsList = HTMLCommentsList + "<table border= '1'><tr><th>Item No: (e.g. A2)</th><th>Comments</th></tr><tr><td WIDTH='10%'>"+row["ORDERNUMBER"]+"</td>"+ "<td WIDTH='90%'>"+row["COMMENTS"]+"</td></tr></table>"; } } Even though column width is given while running in PDF format width is divided into 50/50 and as 10/90. Reproducible: Always Steps to Reproduce: 1.create a table on render script 2.copy the above code 3.run the report in PDF format
Would you please attach the test report for reproducing?
As I could not able to attach rptdesign file.I am sending it through mail.Please check the mail.
Created attachment 176296 [details] test report
Created attachment 184087 [details] A test case using both styling and the width attribute This report is experiencing similar issues to the original test report. It is organized as a grid control, with a Text control inside. The content of the Text control is a table that uses an inline style for width on the first column and no width on the second. In the second column is an embedded table with width defined in the first <td> width attribute. Neither approach works for configuring the column width.
This problem starts in the TableProcessor$TableState.processNodes() method. In that method, you can see that only <col> tags are analyzed for width information. <td> tags are not analyzed for width information, even in the TableProcessor$CellState class, although they probably should be since this is the most common approach to HTML table definitions. Unfortunately, it does not appear that styled width information is processed at any level for any tag. For table columns, the width must be placed in the width attribute, e.g.: <table> <col width="10%"> </col> <col> </col> <tr> <td>10%</td> <td>90%</td> </tr> </table> This works fine if you do not need a width measurement in something other than % or px. However, if you need it in, for instance, "em", that poses issues because the col width attribute has an HTML limitation that forbids it. However, it will display correctly in the PDF output when "em" is used because the PDF conversion does not have that limitation. I encountered this issue while creating an ExtendedReportItem plug-in control, so it was possible to vary the output according to the target (PDF or HTML), you'd need to set up visibility rules on two separate Text controls to get a similar result. In that case you'd have to use <col width="2em"> for the PDF target and <col style="width: 2em"> for the HTML target.
BIRT does not officially support the table tag in HTML text items. And I think that's sad, but ok - I don't know of any other comparable tool that would support this. You should use Grid or Table items to create the desired layout. That's the way to go - except if you want to display dynamic, user-generated HTML including tables. BIRT is not a HTML-to-anything converter, but a report engine.