Hi.
Somebody has tried to convert a html table from their definition to an excel file.
I'm trying to do it using hssf poi and
sheet.addMergedRegion(new CellRangeAddress(int firstRow, int lasRow, int firstCol, int lastCol)) but I'm getting problem to place the cells with rowspan and colspan, because I have to use index to place exactly the region.
Let say we have the next definition:
<table id="11" cols="7">
<tr>
<td align="center" styleClass="logo" colspan="2" title="logo" media="/xmlhttp/images/logobd3.gif">
</td>
<td styleClass="LCAB" align="center" colspan="5"
title="header..id_11.title">
</td>
</tr>
<tr>
<td styleClass="LCAB" rowspan="3" align="center" colspan="2"
title="header.id_11.row_1">
</td>
<td styleClass="LN" rowspan="3" align="center"
title="header.id_11.row_2">
</td>
<td styleClass="LN" colspan="3" align="center"
title="header.id_11.row_3">
</td>
<td rowspan="3" align="center" styleClass="LN2"
title="header.id_11.row_4">
</td>
</tr>
<tr>
<td styleClass="LN" rowspan="2" align="center"
title="header.id_11.row_5">
</td>
<td styleClass="LN" colspan="2" align="center"
title="header.id_11.row_6">
</td>
</tr>
<tr>
<td styleClass="LN" align="center"
title="header.id_11.row_7">
</td>
<td styleClass="LN" align="center"
title="header.id_11.row_8">
</td>
</tr>
</table>
Parsing using DOM I know when I get a new row, a new column, etc.. but I'm not be able to do. Maybe there is another way to deal with it.
Any suggestions?
Thanks
Somebody has tried to convert a html table from their definition to an excel file.
I'm trying to do it using hssf poi and
sheet.addMergedRegion(new CellRangeAddress(int firstRow, int lasRow, int firstCol, int lastCol)) but I'm getting problem to place the cells with rowspan and colspan, because I have to use index to place exactly the region.
Let say we have the next definition:
<table id="11" cols="7">
<tr>
<td align="center" styleClass="logo" colspan="2" title="logo" media="/xmlhttp/images/logobd3.gif">
</td>
<td styleClass="LCAB" align="center" colspan="5"
title="header..id_11.title">
</td>
</tr>
<tr>
<td styleClass="LCAB" rowspan="3" align="center" colspan="2"
title="header.id_11.row_1">
</td>
<td styleClass="LN" rowspan="3" align="center"
title="header.id_11.row_2">
</td>
<td styleClass="LN" colspan="3" align="center"
title="header.id_11.row_3">
</td>
<td rowspan="3" align="center" styleClass="LN2"
title="header.id_11.row_4">
</td>
</tr>
<tr>
<td styleClass="LN" rowspan="2" align="center"
title="header.id_11.row_5">
</td>
<td styleClass="LN" colspan="2" align="center"
title="header.id_11.row_6">
</td>
</tr>
<tr>
<td styleClass="LN" align="center"
title="header.id_11.row_7">
</td>
<td styleClass="LN" align="center"
title="header.id_11.row_8">
</td>
</tr>
</table>
Parsing using DOM I know when I get a new row, a new column, etc.. but I'm not be able to do. Maybe there is another way to deal with it.
Any suggestions?
Thanks