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 2015/09/17 13:14:50 UTC

svn commit: r1703574 [2/2] - in /poi/site: publish/ publish/apidocs/ publish/apidocs/org/apache/poi/hssf/usermodel/ publish/apidocs/org/apache/poi/ss/usermodel/ publish/apidocs/org/apache/poi/ss/usermodel/class-use/ publish/apidocs/org/apache/poi/xssf/...

Modified: poi/site/src/documentation/content/xdocs/spreadsheet/eval.xml
URL: http://svn.apache.org/viewvc/poi/site/src/documentation/content/xdocs/spreadsheet/eval.xml?rev=1703574&r1=1703573&r2=1703574&view=diff
==============================================================================
--- poi/site/src/documentation/content/xdocs/spreadsheet/eval.xml (original)
+++ poi/site/src/documentation/content/xdocs/spreadsheet/eval.xml Thu Sep 17 11:14:47 2015
@@ -214,11 +214,10 @@ if (cell!=null) {
 FileInputStream fis = new FileInputStream("/somepath/test.xls");
 Workbook wb = new HSSFWorkbook(fis); //or new XSSFWorkbook("/somepath/test.xls")
 FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator();
-for(int sheetNum = 0; sheetNum < wb.getNumberOfSheets(); sheetNum++) {
-    Sheet sheet = wb.getSheetAt(sheetNum);
-    for(Row r : sheet) {
-        for(Cell c : r) {
-            if(c.getCellType() == Cell.CELL_TYPE_FORMULA) {
+for (Sheet sheet : wb) {
+    for (Row r : sheet) {
+        for (Cell c : r) {
+            if (c.getCellType() == Cell.CELL_TYPE_FORMULA) {
                 evaluator.evaluateFormulaCell(c);
             }
         }

Modified: poi/site/src/documentation/content/xdocs/spreadsheet/quick-guide.xml
URL: http://svn.apache.org/viewvc/poi/site/src/documentation/content/xdocs/spreadsheet/quick-guide.xml?rev=1703574&r1=1703573&r2=1703574&view=diff
==============================================================================
--- poi/site/src/documentation/content/xdocs/spreadsheet/quick-guide.xml (original)
+++ poi/site/src/documentation/content/xdocs/spreadsheet/quick-guide.xml Thu Sep 17 11:14:47 2015
@@ -324,22 +324,22 @@
                 </section>
                 <anchor id="Iterator"/>
                 <section><title>Iterate over rows and cells</title>
-				<p>Sometimes, you'd like to just iterate over all the rows in
-				a sheet, or all the cells in a row. This is possible with
-				a simple for loop.</p>
-				<p>Luckily, this is very easy. Row defines a 
-				<em>CellIterator</em> inner class to handle iterating over 
-				the cells (get one with a call to <em>row.cellIterator()</em>),
-				and Sheet provides a <em>rowIterator()</em> method to
-				give an iterator over all the rows. These implement the 
-            <em>java.lang.Iterable</em> interface to allow foreach loops.</p>
+				<p>Sometimes, you'd like to just iterate over all the sheets in 
+				a workbook, all the rows in a sheet, or all the cells in a row.
+				This is possible with a simple for loop.</p>
+				<p>These iterators are available by calling <em>workbook.sheetIterator()</em>,
+				<em>sheet.rowIterator()</em>, and <em>row.cellIterator()</em>, or
+				implicitly using a for-each loop.
+				Note that a rowIterator and cellIterator iterate over rows or
+				cells that have been created, skipping empty rows and cells.</p>
 
 				<source>
-    Sheet sheet = wb.getSheetAt(0);
-    for (Row row : sheet) {
-      for (Cell cell : row) {
-        // Do something here
-      }
+    for (Sheet sheet : wb ) {
+        for (Row row : sheet) {
+            for (Cell cell : row) {
+                // Do something here
+            }
+        }
     }
 				</source>
             </section>

Modified: poi/site/src/documentation/content/xdocs/status.xml
URL: http://svn.apache.org/viewvc/poi/site/src/documentation/content/xdocs/status.xml?rev=1703574&r1=1703573&r2=1703574&view=diff
==============================================================================
--- poi/site/src/documentation/content/xdocs/status.xml (original)
+++ poi/site/src/documentation/content/xdocs/status.xml Thu Sep 17 11:14:47 2015
@@ -39,6 +39,7 @@
     </devs>
 
     <release version="3.13-beta2" date="2015-10-??">
+        <action dev="PD" type="add" fixes-bug="58245">Workbook support for iterating over Sheets</action>
         <action dev="PD" type="fix" fixes-bug="58353">Return correct value in Match-Function with match-type == -1</action>
         <action dev="PD" type="fix" fixes-bug="58315">Avoid NPE for RichTextString without font-details</action>
         <action dev="PD" type="fix" fixes-bug="53275">XSSFFont: reset indexed color flag when setting a non-indexed color</action>



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