Sorry to say this, but I am certain now that you will need to write code to
parse the html, strip out the tags and create a cell style to apply to the
cell that contains the mark-up. To convince myself of this, the final test I
unbertook was to manually edit the zipped xml of an OOXML based Excel
workbook file. That way, I was able to ascertain that the mark-up was not
parsed as the file was read and that it is the process of pasting that
allows Excel to render the mark-up. Sorry.
Yours
Mark B
Me Simple wrote:
>
> Hi,
>
> I am using Apachi POI to create a excel file on runtime. The excel file
> may have variable number columns (number of columns depends on run time).
> The value for One of the column has HTML parsed html string as shown
> below:
>
> Listing 1:
>
> <html>My String</html>
>
> However, when I open the excel file, the HTML column appears as is and
> doesn't appear parsed like this one.
>
> Listing 2:
>
> My String
>
> Is there a way to display the html as shown in listing 2 in run time.
>
>
> thanks.
>
> The code used for creating a the cell is shown below:
>
>
> HSSFCellStyle headerCellStyle;
> HSSFWorkbook workBook = null;
>
> workBook = new HSSFWorkbook();
>
> HSSFCell cell = row.createCell(columnIndex);
> HSSFRichTextString textString = new HSSFRichTextString(value);
> headerCellStyle = workBook.createCellStyle();
> headerCellStyle.setFont(getHeaderFont());
> headerCellStyle.setWrapText(false);
>
> cell.setCellStyle(headerCellStyle);
> cell.setCellValue("<html>My String</html>");
>
--
View this message in context:
http://old.nabble.com/SHow-HTML-text-in-one-of-the-excel-cell-tp29144294p29174657.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]