You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Axel Rose <ax...@googlemail.com> on 2008/06/12 16:41:34 UTC

Distinguishing default cell style

Hello all,

when importing Excel files is there a way to check whether a cell was
formatted using a style?

When looping through all cells and doing

  // opening HSSFWorkbook "wb"
  // retrieving HSSFCell "cell"
  // ...
  HSSFCellStyle cellStyle = cell.getCellStyle();
  wb.getCellStyleAt(cellStyle.getIndex());

I just always get some cell style. Currently I cannot see if this is just
the default cell style.

Is there a way to get the name of the cell style as shown in the client app?


Thanks for your help,
Axel.

Re: Distinguishing default cell style

Posted by Axel Rose <ax...@googlemail.com>.
> When you are talking about 'styles' are you referring here to Excel's
> styles where it is possible to establish a number of formatting options and
> then associate a name with this?
>

Yes indeed. Sorry for being fuzzy.

Axel.

Re: Distinguishing default cell style

Posted by Anthony Andrews <py...@yahoo.com>.
When you are talking about 'styles' are you referring here to Excel's styles where it is possible to establish a number of formatting options and then associate a name with this?

--- On Thu, 6/12/08, Axel Rose &lt;axel.roeslein@googlemail.com&gt; wrote:
From: Axel Rose &lt;axel.roeslein@googlemail.com&gt;
Subject: Distinguishing default cell style
To: "POI Users List" &lt;user@poi.apache.org&gt;
Date: Thursday, June 12, 2008, 7:41 AM

Hello all,

when importing Excel files is there a way to check whether a cell was
formatted using a style?

When looping through all cells and doing

  // opening HSSFWorkbook "wb"
  // retrieving HSSFCell "cell"
  // ...
  HSSFCellStyle cellStyle = cell.getCellStyle();
  wb.getCellStyleAt(cellStyle.getIndex());

I just always get some cell style. Currently I cannot see if this is just
the default cell style.

Is there a way to get the name of the cell style as shown in the client app?


Thanks for your help,
Axel.