ASF Bugzilla – Attachment 21729 Details for
Bug 44688
Insertion of multiple comments
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
unit test containing one unused object of HSSFComment
Test3.java (text/plain), 1.62 KB, created by
SUMIT
on 2008-03-27 23:58:40 UTC
(
hide
)
Description:
unit test containing one unused object of HSSFComment
Filename:
MIME Type:
Creator:
SUMIT
Created:
2008-03-27 23:58:40 UTC
Size:
1.62 KB
patch
obsolete
>import java.io.*; > >import org.apache.poi.hssf.usermodel.*; > > >// IN this test file i have created 3 cells and 2 comment objects and have not used one comment object >// The comment object which is not used is being displayed in excel file in the first cell which is total disaster... > >public class Test3 { > > > public static void main(String[] args) throws IOException { > > HSSFWorkbook wb=new HSSFWorkbook(); > HSSFSheet finalsheet=wb.createSheet(); > > HSSFCell cell1=finalsheet.createRow(0).createCell((short) 5); > HSSFCell cell2=finalsheet.createRow(0).createCell((short) 6); > HSSFCell cell3=finalsheet.createRow(1).createCell((short) 6); > > HSSFPatriarch patr = finalsheet.createDrawingPatriarch(); > HSSFComment comment1 = patr.createComment(new HSSFClientAnchor(0, 100, 0, 0, (short)4, 2, (short) 6, 5)); > comment1.setString(new HSSFRichTextString("help me 1")); > comment1.setAuthor("SUMIT"); > HSSFComment comment2 = patr.createComment(new HSSFClientAnchor(0, 100, 0, 0, (short)4, 2, (short) 6, 5)); > comment2.setString(new HSSFRichTextString("help me 2")); > comment2.setAuthor("SUMIT"); > > cell1.setCellComment(comment1); > cell2.setCellComment(comment1); > cell3.setCellComment(comment1); > > > ByteArrayOutputStream out= new ByteArrayOutputStream(); > wb.write(out); > out.close(); > HSSFWorkbook wbNew=new HSSFWorkbook(); > wbNew = new HSSFWorkbook(new ByteArrayInputStream(out.toByteArray())); > > > FileOutputStream out1 = new FileOutputStream("workbook3.xls"); > wbNew.write(out1); > out1.close(); > System.out.println("end of test"); > > > } > >}
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 44688
:
21727
|
21728
| 21729 |
21730