poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mead Lai <laiqi...@gmail.com>
Subject Re: how to set to first column and first row active.
Date Fri, 30 Mar 2012 06:49:32 GMT
Thank you Mark.

Following is my code, but it doesn't work at all.
Is there some problem?
==================
==================

HSSFCell cc = sourceRow.getCell(0);
if(cc ==null){
cc = sourceRow.createCell(0);
}
cc.setCellValue("");
cc.setAsActiveCell();
sheet.setColumnWidth(0, 3500);
fos = new FileOutputStream(path + "/update.xls");
wbCreat.write(fos);

Regards,
Mead


On Fri, Mar 30, 2012 at 2:31 PM, Mark Beardsley <markbrdsly@tiscali.co.uk>wrote:

> The first thing that springs to mind is the setAsActiveCell() method
> defined
> for both XSSFCell and HSSFCell. Once you have built the worksheet, get a
> reference for cell A1 and call the setAsActiveCell() method on that before
> you save the file away; it might even be possible to call this method at
> the
> start of the process, as you are building the worksheet and creating cell
> A1
> (assuming that is top, left hand most cell that users can populate on the
> sheet).
>
> --
> View this message in context:
> http://apache-poi.1045710.n5.nabble.com/how-to-set-to-first-column-and-first-row-active-tp5605774p5605803.html
> Sent from the POI - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message