Hi,

Thank you for replying so quickly.

You are right... I am getting a runtime Error ... not a compilation error.

I have the following Enviroment Details:

Application has been deployed in Weblogic Server. ( JDK 1.5.0_04 )

I have the following two lib files deployed in my application.

poi-3.0.2-FINAL-20080204.jar and poi-contrib-3.0.2-FINAL.jar

I am using Eclipse to develop my code .. I am using the same JDK to compile
my code also.

and My code block which is throwing an exception is as follows:

        int rowCnt = 2;
        int colCnt = 2;
        HSSFCellStyle evtDetailsTitleCellStyle = wb.createCellStyle();

        evtDetailsTitleCellStyle.setFillPattern(HSSFCellStyle.NO_FILL);
        HSSFFont evtDetailsTitleFont = wb.createFont();
        evtDetailsTitleFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
        evtDetailsTitleFont.setFontName(HSSFFont.FONT_ARIAL);
        evtDetailsTitleFont.setFontHeight((short)180);
        evtDetailsTitleFont.setColor(HSSFColor.BLACK.index);
        evtDetailsTitleCellStyle.setFont(evtDetailsTitleFont);

        row = sheet.createRow((short) rowCnt);
        cell = row.createCell((short)colCnt);

        sheet.addMergedRegion(new Region(rowCnt, (short)colCnt, rowCnt,
(short)(colCnt+1)));

        cell.setCellType(HSSFCell.CELL_TYPE_STRING);
        cell.setCellStyle(evtDetailsTitleCellStyle);

        HSSFRichTextString hrts = new HSSFRichTextString("Testing");
        cell.setCellValue(hrts);
        //cell.setCellValue("Event Name:");

Please let me know if you need more details about my problem.

Thanks,
Subhakar.


On Wed, Apr 2, 2008 at 11:41 AM, J Keller <[EMAIL PROTECTED]>
wrote:

> What error are you getting?
>
> Is the cell type CELL_TYPE_STRING?  You can use cell.getCellType() to
> check.  Though a wrong cell type would be a run-time error, not
> compiliation, I think.
>
> -----Original Message-----
> From: Subhakar Gummadi [mailto:[EMAIL PROTECTED]
>
> I am getting a compilation error when I am using the following Code.
>
>        HSSFRichTextString hrts1 = new
> HSSFRichTextString((String)evtEntity.getEvt_lname());
>        cell.setCellValue(hrts1);
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to