ASF Bugzilla – Attachment 5687 Details for
Bug 18800
The sheet made by HSSFWorkbook#cloneSheet() doesn't work correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
A simple testcase to find it.NullPointerException is caused at line22.
Test.java (text/plain), 898 bytes, created by
Toshiaki Kamoshida
on 2003-04-08 07:56:26 UTC
(
hide
)
Description:
A simple testcase to find it.NullPointerException is caused at line22.
Filename:
MIME Type:
Creator:
Toshiaki Kamoshida
Created:
2003-04-08 07:56:26 UTC
Size:
898 bytes
patch
obsolete
>import java.io.ByteArrayInputStream; >import java.io.ByteArrayOutputStream; > >import org.apache.poi.hssf.usermodel.HSSFCell; >import org.apache.poi.hssf.usermodel.HSSFRow; >import org.apache.poi.hssf.usermodel.HSSFSheet; >import org.apache.poi.hssf.usermodel.HSSFWorkbook; > >public class Test { > public static void main(String[] args) throws Exception { > ByteArrayOutputStream out = new ByteArrayOutputStream(); > HSSFWorkbook book = new HSSFWorkbook(); > book.createSheet("TEST"); > HSSFSheet sheet = book.cloneSheet(0); > book.setSheetName(1,"CLONE"); > sheet.createRow(0).createCell((short)0).setCellValue("Test"); > book.write(out); > > book = new HSSFWorkbook(new ByteArrayInputStream(out.toByteArray())); > sheet = book.getSheet("CLONE"); > HSSFRow row = sheet.getRow(0); > HSSFCell cell = row.getCell((short)0); > System.out.println(cell.getStringCellValue()); > > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 18800
: 5687