Hi,

> The questions: how can i insert a comment without loosing the
> previously  created comments? Is there a method to a get a reference to
> a HSSFPatriarch without creating a new one?


Unfortunately you can't do that. There is no way to get a reference to
the existing HSSFPatriarch. Current implementation of the HSSF drawing
layer is meant for creating new drawings, not for editing the existing
ones.
I hope this limitation will be overcome eventually.

Regards,
Yegor

> thanks,


> the code:

> try {

>     in = new FileInputStream(this.reportfile);
>     wb = new HSSFWorkbook(in);
>     
>     /* first set the data in the Reporte sheet */
>     report_sheet = wb.getSheet("Reporte");
>     patr = report_sheet.createDrawingPatriarch();
>     
>     
>     /* create rows, cells 
>     .
>     .
>     .*/
>     
>     /* set comment */
>     prov_comment = patr.createComment(new HSSFClientAnchor(0, 0, 0, 0,
> (short)4, 2, (short) 8, 7));
>     prov_comment.setString(new HSSFRichTextString("Comment");
>     row[0].getCell(short(2)).setCellComment(prov_comment);
>         
>     
>     //write out excel
>     out = new FileOutputStream(reportfile);
>     wb.write(out);
>     out.close();
>     
> } catch (IOException ioe) {
>     log.error(ioe);
> } catch (Exception e){
>     log.error(e);
>     e.printStackTrace();
> }




>      
> ____________________________________________________________________________________
> Luggage? GPS? Comic books? 
> Check out fitting gifts for grads at Yahoo! Search
> http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz

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


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

Reply via email to