You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ni...@apache.org on 2011/02/23 16:27:38 UTC

svn commit: r1073780 - /poi/trunk/src/documentation/content/xdocs/spreadsheet/quick-guide.xml

Author: nick
Date: Wed Feb 23 15:27:38 2011
New Revision: 1073780

URL: http://svn.apache.org/viewvc?rev=1073780&view=rev
Log:
Update the HSSF/XSSF comments documentation to include some more steps that are needed to have the comments always show up properly

Modified:
    poi/trunk/src/documentation/content/xdocs/spreadsheet/quick-guide.xml

Modified: poi/trunk/src/documentation/content/xdocs/spreadsheet/quick-guide.xml
URL: http://svn.apache.org/viewvc/poi/trunk/src/documentation/content/xdocs/spreadsheet/quick-guide.xml?rev=1073780&r1=1073779&r2=1073780&view=diff
==============================================================================
--- poi/trunk/src/documentation/content/xdocs/spreadsheet/quick-guide.xml (original)
+++ poi/trunk/src/documentation/content/xdocs/spreadsheet/quick-guide.xml Wed Feb 23 15:27:38 2011
@@ -1333,17 +1333,26 @@ Examples:
 
     Sheet sheet = wb.createSheet();
     
-    Cell cell = sheet.createRow(3).createCell(5);
+    Rowl row  = sheet.createRow(3);
+    Cell cell = row.createCell(5);
     cell.setCellValue("F4");
     
     Drawing drawing = sheet.createDrawingPatriarch();
 
+    // When the comment box is visible, have it show in a 1x3 space
     ClientAnchor anchor = factory.createClientAnchor();
+    anchor.setCol1(cell.getColumnIndex());
+    anchor.setCol2(cell.getColumnIndex()+1);
+    anchor.setRow1(row.getRowNul());
+    anchor.setRow2(row.getRowNul()+3);
+
+    // Create the comment and set the text+author
     Comment comment = drawing.createCellComment(anchor);
     RichTextString str = factory.createRichTextString("Hello, World!");
     comment.setString(str);
     comment.setAuthor("Apache POI");
-    //assign the comment to the cell
+
+    // Assign the comment to the cell
     cell.setCellComment(comment);
 
     String fname = "comment-xssf.xls";



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org