DO NOT REPLY [Bug 44688] Insertion of multiple comments

2008-03-28 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=44688





--- Comment #5 from SUMIT [EMAIL PROTECTED]  2008-03-27 23:49:48 PST ---
Created an attachment (id=21727)
 -- (https://issues.apache.org/bugzilla/attachment.cgi?id=21727)
test case 

This  test file creates object of cell and comment in a loop and the output
is--- comment in only one cell

this happens even after writing in ByteArrayOutputStream and then reading from
ByteArrayInputStream


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 44688] Insertion of multiple comments

2008-03-28 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=44688


SUMIT [EMAIL PROTECTED] changed:

   What|Removed |Added

  Attachment #21727|test case   |test case containing object
description||of HSSFComment being created
   ||in a loop




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 44688] Insertion of multiple comments

2008-03-28 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=44688





--- Comment #6 from SUMIT [EMAIL PROTECTED]  2008-03-27 23:54:40 PST ---
Created an attachment (id=21728)
 -- (https://issues.apache.org/bugzilla/attachment.cgi?id=21728)
unit test containing one object of comment for all the cells 

This  test file has only one comment for three cells and the output is
--comment in only one cell
this happens even after writing in ByteArrayOutputStream and then reading from
ByteArrayInputStream


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 44688] Insertion of multiple comments

2008-03-28 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=44688





--- Comment #7 from SUMIT [EMAIL PROTECTED]  2008-03-27 23:58:40 PST ---
Created an attachment (id=21729)
 -- (https://issues.apache.org/bugzilla/attachment.cgi?id=21729)
unit test containing one unused object of HSSFComment 

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... 


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 44688] Insertion of multiple comments

2008-03-28 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=44688


SUMIT [EMAIL PROTECTED] changed:

   What|Removed |Added

  Attachment #21730|test case showing more than |unit test showing more than
description|1 comment in a excel file   |1 comment in a excel file




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 44688] Insertion of multiple comments

2008-03-28 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=44688


Yegor Kozlov [EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||WONTFIX




--- Comment #9 from Yegor Kozlov [EMAIL PROTECTED]  2008-03-28 05:00:34 PST 
---
Hi,

(1) A comment can be assigned to only one cell. If you assign the same comment
object to multiple cells then only the last cell will have it. 
(2) HSSFPatriarch is a sheet-scope object, not comment-scope. Move it out of
the loop and all will be fine:

HSSFPatriarch patr = finalsheet.createDrawingPatriarch();
for(int i=0;i3;i++)
{
  HSSFCell cell1=finalsheet.createRow(2).createCell((short) i);
  HSSFComment comment1 = patr.createComment(new HSSFClientAnchor(0, 100, 0, 0,
(short)4, 2, (short) 6, 5));
}

I updated the docs to state it.

(3) In the forth example you don't set comment text for comment2 and comment3.
Excel doesn't like it and says the file is corrupted.

Check the code:

 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));
 HSSFComment comment2 = patr.createComment(new HSSFClientAnchor(0, 100, 0, 0,
(short)4, 2, (short) 6, 5));
 //should it be comment2 
 comment1.setString(new HSSFRichTextString(help me 2));

 HSSFComment comment3 = patr.createComment(new HSSFClientAnchor(0, 100, 0, 0,
(short)4, 2, (short) 6, 5));
 //should it be comment3 
 comment1.setString(new HSSFRichTextString(help me 3));

 cell1.setCellComment(comment1);
 cell2.setCellComment(comment2);
 cell3.setCellComment(comment3);

It looks like a copy/paste bug. 

(4) Your problem has nothing to do with serialization. It doesn't matter if you
write directly to FileOutputStream or serialize in a byte buffer and then to a
file. 

Regards,
Yegor


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 44688] Insertion of multiple comments

2008-03-27 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=44688


SUMIT [EMAIL PROTECTED] changed:

   What|Removed |Added

 CC||[EMAIL PROTECTED]




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 44688] Insertion of multiple comments

2008-03-27 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=44688


SUMIT [EMAIL PROTECTED] changed:

   What|Removed |Added

   Priority|P1  |P2




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 44688] Insertion of multiple comments

2008-03-27 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=44688


Nick Burch [EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |NEEDINFO




--- Comment #1 from Nick Burch [EMAIL PROTECTED]  2008-03-27 05:02:44 PST ---
I have a feeling that a comment can only be added to one cell

If you create+attach one comment per cell, does it all work?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 44688] Insertion of multiple comments

2008-03-27 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=44688





--- Comment #2 from SUMIT [EMAIL PROTECTED]  2008-03-27 05:14:43 PST ---
--- Comment #1 from Nick Burch [EMAIL PROTECTED]  2008-03-27 05:02:44 PST ---
I have a feeling that a comment can only be added to one cell

If you create+attach one comment per cell, does it all work?

---Sumit


i have tried this too. i am creating the object of HSSFComment and HSSFCell in
a loop and try to set that new object of comment in the cell and that too in a
loop

expected result--comment in all the cells

result--only one comment comes and that too in arbitary cell


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 44688] Insertion of multiple comments

2008-03-27 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=44688


SUMIT [EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEEDINFO|ASSIGNED




--- Comment #3 from SUMIT [EMAIL PROTECTED]  2008-03-27 05:28:09 PST ---
I tried creating object of HSSFCell and HSSFComment object in a loop andtry to
set that new object of comment in new cell.

i.e. i m always creating a new object of comment for each cell but thatdoest
not even work.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 44688] Insertion of multiple comments

2008-03-27 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=44688


Nick Burch [EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|ASSIGNED|NEEDINFO




--- Comment #4 from Nick Burch [EMAIL PROTECTED]  2008-03-27 05:50:15 PST ---
If you add comments with poi, save and re-load into poi, do they appear on the
correct cells then?

If not, could you please knock up a quick unit test for the problem? Just
something that creates a new workbook and sheet, and adds a few cells, attaches
comments to those. Write a to ByteArrayOutputStream, read in again from a
ByteArrayInputStream, and assert that the comments are on the right cells (this
bit will fail)

We'll then have something to test future fixes against


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]