You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I like your toolkit and the OpenDocument format is very easy to understand and save your data in.
I have encountered a problem, whne I try to iterate all cells using the below code:
import org.odftoolkit.odfdom.doc.OdfSpreadsheetDocument;
import org.odftoolkit.odfdom.doc.table.OdfTable;
import org.odftoolkit.odfdom.doc.table.OdfTableRow;
import org.odftoolkit.odfdom.doc.table.OdfTableCell;
OdfSpreadsheetDocument spreadsheet = OdfSpreadsheetDocument.loadDocument(filepath);
List<OdfTable> tables = spreadsheet.getSpreadsheetTables();
for (OdfTable table : tables) {
List<OdfTableRow> rows = table.getRowList();
for (OdfTableRow row : rows) {
List<OdfTableCell> cells = row.getCellList(); // .getCellList() is not recognized
for (OdfTableCell cell : cells) {
// Do something with cell
}
}
}
This code is not recognized row.getCellList();.
Instead if I use this approach, the iteration works, but it does not iterate over an OdfTableCell data type but it iterates a Node data type, which is not what I want:
import org.odftoolkit.odfdom.doc.OdfSpreadsheetDocument;
import org.odftoolkit.odfdom.doc.table.OdfTable;
import org.odftoolkit.odfdom.doc.table.OdfTableRow;
import org.odftoolkit.odfdom.doc.table.OdfTableCell;
OdfSpreadsheetDocument spreadsheet = OdfSpreadsheetDocument.loadDocument(filepath);
List<OdfTable> tables = spreadsheet.getSpreadsheetTables();
for (OdfTable table : tables) {
List<OdfTableRow> rows = table.getRowList();
for (OdfTableRow row : rows) {
NodeList cells = row.getOdfElement().getChildNodes();
for (int i = 0; i < cells.getLength(); i++) {
Node cell = cells.item(i);
// Do something with cell
}
}
}
So my question is, why is .getCellList() missing when iterating rows and can it be added to the toolkit?
The text was updated successfully, but these errors were encountered:
apparently class OdfTableRow offers only getCellByIndex() and getCellCount(), whereas class OdfTable has getRowByIndex(), getRowCount() and getRowList().
looks like the OdfTable methods were added in 2011 with 0170c73 while OdfTableRow methods are from 2009...
it's not obvious why a getCellList() is missing; it sounds useful, please add it and submit a pull request :)
Hello
I like your toolkit and the OpenDocument format is very easy to understand and save your data in.
I have encountered a problem, whne I try to iterate all cells using the below code:
This code is not recognized
row.getCellList();
.Instead if I use this approach, the iteration works, but it does not iterate over an OdfTableCell data type but it iterates a Node data type, which is not what I want:
So my question is, why is
.getCellList()
missing when iterating rows and can it be added to the toolkit?The text was updated successfully, but these errors were encountered: