poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yegor Kozlov <yegor.koz...@dinom.ru>
Subject Re: hi, I have a ploblem about produce excel2007 file
Date Tue, 13 Mar 2012 08:20:17 GMT
Try the latest build from trunk. POI-3.7 is more than a year old and
many bugs have been fixed since then.

Yegor

On Tue, Feb 21, 2012 at 8:24 PM, RA <zxlblsaber@163.com> wrote:
> I want to make the cell offer some options for the user to choose just like
> excel 2003.
> I tried with POI3.7. But the produced excel2007 file is wrong, it can not be
> opened.
>
>
> Here are the core code I write:
>
>
>
> public static void write(OutputStream outputStream) throws
>  IOException, ClassNotFoundException
>  {
>
>     XSSFWorkbook workbook = new XSSFWorkbook();
>
>     XSSFSheet sheet = workbook.createSheet("sheet1");
>
>     String[] strs = new String[]{"A", "B", "C"};
>
>     CellRangeAddressList regions = new CellRangeAddressList(0, 9, 0, 0);
>
>     XSSFDataValidationConstraint constraint = new XSSFDataValidationConstraint
> (strs);
>     CTDataValidation ct = CTDataValidation.Factory.newInstance();
>     //while in 2007 the method is changed not like the 2003 I do not know if
> the method I invoke is right.
>     XSSFDataValidation dataValidation = new XSSFDataValidation(constraint,
> regions, ct);
>     sheet.addValidationData(dataValidation);
>
>     workbook.write(outputStream);
>  }
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Mime
View raw message