summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpshi2012-05-15 22:36:12 (EDT)
committer mwu2012-05-15 22:36:12 (EDT)
commit0fd5f4c29ccab9601d8c163ea960c43d74b1a9e4 (patch)
tree931ae3e82d07176b6baef345bd0fbd4f70c549ea
parent621872845c42595789271e102c630f35c8dddc35 (diff)
downloadorg.eclipse.birt-0fd5f4c29ccab9601d8c163ea960c43d74b1a9e4.zip
org.eclipse.birt-0fd5f4c29ccab9601d8c163ea960c43d74b1a9e4.tar.gz
org.eclipse.birt-0fd5f4c29ccab9601d8c163ea960c43d74b1a9e4.tar.bz2
fix 49898 Cannot find all 112 columns in xlsx by OOTB Excel Connector
-rw-r--r--data/org.eclipse.birt.report.data.oda.excel/src/org/eclipse/birt/report/data/oda/excel/impl/util/XlsxFileReader.java24
1 files changed, 15 insertions, 9 deletions
diff --git a/data/org.eclipse.birt.report.data.oda.excel/src/org/eclipse/birt/report/data/oda/excel/impl/util/XlsxFileReader.java b/data/org.eclipse.birt.report.data.oda.excel/src/org/eclipse/birt/report/data/oda/excel/impl/util/XlsxFileReader.java
index 0339bfe..96fa54b 100644
--- a/data/org.eclipse.birt.report.data.oda.excel/src/org/eclipse/birt/report/data/oda/excel/impl/util/XlsxFileReader.java
+++ b/data/org.eclipse.birt.report.data.oda.excel/src/org/eclipse/birt/report/data/oda/excel/impl/util/XlsxFileReader.java
@@ -257,17 +257,23 @@ public class XlsxFileReader {
}
private int getColumnNumber(String colname) {
+ int tmpcol = 0;
+ String drpNumber = colname;
+ for (int ch = 0; ch < colname.length(); ++ch) {
+ if (!Character.isLetter(colname.charAt(ch))) {
+ drpNumber = colname.substring(0, ch);
+ break;
+ }
+ }
- int tmpcol = 0;
+ int sum = 0;
+ for (int ii = 0; ii < drpNumber.length(); ii++) {
+ tmpcol = (drpNumber.charAt(ii) - 'A') + 1;
+ sum = sum * 26 + tmpcol;
+ }
+ return sum - 1;
- //remove cell number
- for (int ch = 0; ch < colname.length(); ++ch) {
- if( Character.isLetter(colname.charAt(ch)) ){
- tmpcol = (ch*26) + colname.charAt(ch) - 'A';
- }
- }
- return tmpcol;
- }
+ }
}
/**