See script below, results, attached screenshot and attached spreadsheet.
=============
var yd = aqua.io.newExcelReader();
yd.setFirstLineContainsColumnNames(false);
yd.setFile("c:\\test.xlsx");
var row;
while((row = yd.readNextRow()) != null)
{
aqua.console.println(row.get(0));
}
yd.close();
=============
Results :
row1colA
row2colB
row3colA
|
55 KB
![]() |
6 KB
fixed.
if one of the column names is null,
yd.setColumnNames(['a', null,'c']);
Why would the user set a column name to null and then blame us? I would rather avoid situation where we have to sanitize the arrays.
yd.columnStructure.columnNames is also null instead of being string[] where one of the elements
happens to be null.
Unless explicitly set, this variable will be null. If will be set by the reader after reading the first row if setFirstLineContainsColumnNames() is set to true.
What is the problem here exactly?
Why set a column name to null? I am manually reading the first line in the file, creating an array,
then calling setColumnNames(). If one of the colums in the file is blank, the array element will
have a null element.
The user may scan the resulting row to identify null elements and replace them with "Column2", etc.
It is impossible to know what the users want to do with the information, and I would vote against any hard-coded solution.
Of course, I'd welcome any suggestions.
if one of the column names is null,
yd.setColumnNames(['a', null,'c']);
Why would the user set a column name to null and then blame us? I would rather avoid situation where we have to sanitize the arrays.
yd.columnStructure.columnNames is also null instead of being string[] where one of the elements
happens to be null.
Unless explicitly set, this variable will be null. If will be set by the reader after reading the first row if setFirstLineContainsColumnNames() is set to true.
What is the problem here exactly?
Why set a column name to null? I am manually reading the first line in the file, creating an array,
then calling setColumnNames(). If one of the colums in the file is blank, the array element will
have a null element.
The user may scan the resulting row to identify null elements and replace them with "Column2", etc.
It is impossible to know what the users want to do with the information, and I would vote against any hard-coded solution.
Of course, I'd welcome any suggestions.
1) if you call yd.getColumnStructure().getColumnName() on a column that has a null name, instead of simply returning null, getColumnName() throws a null pointer exception.
2) if one of the column names is null,
1) if you call yd.getColumnStructure().getColumnName() on a column that has a null name, instead of simply returning null, getColumnName() throws a null pointer exception.
2) if one of the column names is null,
Issue #6195 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build 10.0.3_06 |
No time estimate |
fixed.