hi users/dev's,
I have some HTML code as below and , if I copy paste that in an EXCEL
file , I can see a proper page , now can I use APACHE POI to do such a thing
automatically ? I tried to create a cell with all the HTML code as a
HSSFRichTextString , but I just see the HTML code as it is...Please let me
know if this is possible.
Java code
HSSFSheet sheet1 = wb.createSheet(files[i].getName()+"new sheet");
HSSFRow row = sheet1.createRow((short) 0);
HSSFCell cell= row.createCell((short)2);
cell.setEncoding(HSSFCell.ENCODING_UTF_16);
cell.setCellValue(new
HSSFRichTextString(contents.toString()));
HTML code
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="ProgId" content="Excel.Sheet">
<meta name="Generator" content="Microsoft Excel 9">
<style>
<!--table
{mso-displayed-decimal-separator:"\.";
mso-displayed-thousand-separator:"\,";}
@page
{margin:1.0in .75in 1.0in .75in;
mso-header-margin:.5in;
mso-footer-margin:.5in;}
tr
{mso-height-source:auto;}
col
{mso-width-source:auto;}
br
{mso-data-placement:same-cell;}
.style0
{mso-number-format:General;
text-align:general;
vertical-align:bottom;
white-space:nowrap;
mso-rotate:0;
mso-background-source:auto;
mso-pattern:auto;
color:windowtext;
font-size:10.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:Arial;
mso-generic-font-family:auto;
mso-font-charset:0;
border:none;
mso-protection:locked visible;
mso-style-name:Normal;
mso-style-id:0;}
td
{mso-style-parent:style0;
padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:windowtext;
font-size:10.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:Arial;
mso-generic-font-family:auto;
mso-font-charset:0;
mso-number-format:General;
text-align:general;
vertical-align:bottom;
border:none;
mso-background-source:auto;
mso-pattern:auto;
mso-protection:locked visible;
white-space:nowrap;
mso-rotate:0;}
.font11
{font-size:7.0pt;
}
.font10
{color:#FFFFFF;
}
.font5
{font-size:28.0pt;
font-weight:700;
font-family:Arial;
}
.font8
{font-size:14.0pt;
font-style:italic;
font-family:Arial;
}
.font6
{font-size:16.0pt;
font-family:Arial;
}
.font9
{font-size:8.0pt;
}
.font7
{font-size:14.0pt;
font-weight:700;
font-family:Arial;
}
.xl24
{mso-style-parent:style0;
white-space:normal;
mso-number-format:"\@";
}
.xl25
{mso-style-parent:style0;
white-space:normal;
mso-number-format:"\@";
text-align:center;
}
.xl26
{mso-style-parent:style0;
white-space:normal;
mso-number-format:"mm\\\/dd\\\/yyyy\;\@";
text-align:right;
}
-->
</style>
<!--[if gte mso 9]>
<xml>
<x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions>
</xml><![endif]-->
</head>
<body style="height:100%">
<table>
<tr>
<td class=xl24>
http://cognos.dev.fyiblue.com/crn/samples/images/hcsc_bcbsil_logo.gif
</img>
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl25>
Nu Investments
</td>
</tr>
<tr>
<td class=xl24>
<style>
@page
{margin:.50in .50in .50in .50in;
mso-header-margin:0in;
mso-footer-margin:0in;
mso-page-orientation:Landscape;
mso-horizontal-page-align:center;
mso-vertical-page-align:center;}
</style>
<x:ExcelWorksheets>
<x:WorksheetOptions>
<x:FitToPage/>
<x:Print>
<x:ValidPrinterInfo/>
</x:Print>
</x:WorksheetOptions>
</ExcelWorksheets></td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl25>
COST
Projection
</td>
</tr>
<tr>
<td class=xl25>
for the period
</td>
</tr>
<tr>
<td class=xl25>
January 1, 2008 - December 31, 2008
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl25>
test PSF fix on copy 1of DES 6/6/07
</td>
</tr>
<tr>
<td class=xl24>
<table>
<tr>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl25>
Presented by:
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl25>
</td>
</tr>
<tr>
<td class=xl25>
Therese Speer
</td>
</tr>
<tr>
<td class=xl24>
<table>
<tr>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl24>
</td>
</tr>
<tr>
<td class=xl25>
A Division of Corporation, a Mutual Legal Reserve Company,
</td>
</tr>
<tr>
<td class=xl25>
an Independent Licensee of the Blue Cross and Blue Shield Association
</td>
</tr>
<tr>
<td class=xl24>
319
</td>
</tr>
<tr>
<td class=xl24>
<table>
<tr>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl24>
</td>
<td class=xl26>
39374
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Thanks
Pradeep
--
View this message in context:
http://www.nabble.com/html-to-excel-tf4667007.html#a13331874
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]