Summary: | HSSFComment or HSSFPatriarch | ||
---|---|---|---|
Product: | POI | Reporter: | Sohel <khsohel> |
Component: | HSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED WONTFIX | ||
Severity: | enhancement | CC: | khsohel |
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP |
Description
Sohel
2008-06-13 10:10:47 UTC
It's not a bug. The 'patriarch' object owns all the drawing elements in the workbook. MS Office drawings, comments, and buttons are all drawing elements. When you call sheet.createDrawingPatriarch(); you are creating a new patriarch object (and therefore removing the one that contained your button). Maybe you want to call sheet.getDrawingPatriarch(); But that method is not completely implemented, because all the types of Escher records that could be components of the patriarch are not completely understood. In particular, I don't think POI yet understands how to associate form elements with macros. Hi Michael, Thanks for the comment. So does it means as of now i can not achieve this by using POI. can anybody suggest some other option to achieve the same. Thanks, Sohel (In reply to comment #1) > It's not a bug. > > The 'patriarch' object owns all the drawing elements in the workbook. MS Office > drawings, comments, and buttons are all drawing elements. > > When you call > > sheet.createDrawingPatriarch(); > > you are creating a new patriarch object (and therefore removing the one that > contained your button). > > Maybe you want to call > > sheet.getDrawingPatriarch(); > > But that method is not completely implemented, because all the types of Escher > records that could be components of the patriarch are not completely > understood. In particular, I don't think POI yet understands how to associate > form elements with macros. > At this time, it's not possible to get at the existing patriach, so you can't add a comment without ditching the old one For now, you should create as many comments as you want at the same time as adding the command. Then, in POI, move those comments to where you need them, and add the text you need. Hi Nick, I am using a excel template which already has some command button embaded in it. these command buttons are used to execute some macro functions. anyway i can not assign a macro function to a command button. so i can not create the above mentioned template using POI. One udpate I have achieved the similar functionality using SmartXL APIs. |