summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpshi2012-05-30 03:36:44 (EDT)
committer mwu2012-05-30 03:36:44 (EDT)
commitf0a2e58d8105a449e05ea3b0e81922980efe9661 (patch)
treeb0363f41378c5a2a5ebf5dabe579cb8df5bbab2d
parent9943d68a3be33e4fcef7cc951bc4ca389ef25b38 (diff)
downloadorg.eclipse.birt-f0a2e58d8105a449e05ea3b0e81922980efe9661.zip
org.eclipse.birt-f0a2e58d8105a449e05ea3b0e81922980efe9661.tar.gz
org.eclipse.birt-f0a2e58d8105a449e05ea3b0e81922980efe9661.tar.bz2
summary:fix 50451,Data set do not updated when datasource changed in
Excel ODA Description of issue: When the data source changed the state of "use second line as data type indicator", the data set cannot be refreshed. Description of resolution: Don't use the cached selected column info, get the column type from the meta data at all times.
-rw-r--r--data/org.eclipse.birt.report.data.oda.excel/src/org/eclipse/birt/report/data/oda/excel/impl/ExcelFileQuery.java44
1 files changed, 18 insertions, 26 deletions
diff --git a/data/org.eclipse.birt.report.data.oda.excel/src/org/eclipse/birt/report/data/oda/excel/impl/ExcelFileQuery.java b/data/org.eclipse.birt.report.data.oda.excel/src/org/eclipse/birt/report/data/oda/excel/impl/ExcelFileQuery.java
index f951e10..2c35297 100644
--- a/data/org.eclipse.birt.report.data.oda.excel/src/org/eclipse/birt/report/data/oda/excel/impl/ExcelFileQuery.java
+++ b/data/org.eclipse.birt.report.data.oda.excel/src/org/eclipse/birt/report/data/oda/excel/impl/ExcelFileQuery.java
@@ -73,8 +73,6 @@ public class ExcelFileQuery implements IQuery {
private String worksheetNames;
- private String savedSelectedColInfo;
-
private String preparedColumnNames;
private String[] columnLabels;
@@ -129,7 +127,6 @@ public class ExcelFileQuery implements IQuery {
QueryTextUtil qtu = new QueryTextUtil(queryText);
String query = formatQueryText(qtu.getQuery());
- savedSelectedColInfo = qtu.getColumnsInfo();
validateNonEmptyQueryText(query);
String[] queryFragments = parsePreparedQueryText(query);
validateSingleTableQuery(queryFragments);
@@ -207,30 +204,25 @@ public class ExcelFileQuery implements IQuery {
queryColumnNames, queryColumnTypes, queryColumnLables);
this.resultSetMetaData = new ResultSetMetaData(
this.resultSetMetaDataHelper);
- } else {
- queryColumnNames = ExcelFileSource
- .getStringArrayFromList(stripFormatInfoFromQueryColumnNames(getQueryColumnNamesVector((preparedColumnNames))));
- validateColumnName(queryColumnNames, allColumnNames);
- if (savedSelectedColInfo == null
- || savedSelectedColInfo.length() == 0) {
- queryColumnTypes = this.hasTypeLine ? getQueryColumnTypes(
- allColumnNames, allColumnTypes, queryColumnNames)
- : createTempColumnTypes(queryColumnNames.length);
- queryColumnLables = this.hasColumnNames ? columnLabels
- : queryColumnNames;
- if (queryColumnLables == null)
- queryColumnLables = queryColumnNames;
- this.resultSetMetaDataHelper = new ResultSetMetaDataHelper(
- queryColumnNames, queryColumnTypes, queryColumnLables);
- this.resultSetMetaData = new ResultSetMetaData(
- this.resultSetMetaDataHelper);
- } else {
- this.resultSetMetaDataHelper = new ResultSetMetaDataHelper(
- savedSelectedColInfo);
- this.resultSetMetaData = new ResultSetMetaData(
- this.resultSetMetaDataHelper);
+ }
+ else
+ {
+ queryColumnNames = ExcelFileSource.getStringArrayFromList( stripFormatInfoFromQueryColumnNames( getQueryColumnNamesVector( ( preparedColumnNames ) ) ) );
+ validateColumnName( queryColumnNames, allColumnNames );
+ queryColumnTypes = this.hasTypeLine
+ ? getQueryColumnTypes( allColumnNames,
+ allColumnTypes,
+ queryColumnNames )
+ : createTempColumnTypes( queryColumnNames.length );
+ queryColumnLables = this.hasColumnNames ? columnLabels
+ : queryColumnNames;
+ if ( queryColumnLables == null )
+ queryColumnLables = queryColumnNames;
+ this.resultSetMetaDataHelper = new ResultSetMetaDataHelper( queryColumnNames,
+ queryColumnTypes,
+ queryColumnLables );
+ this.resultSetMetaData = new ResultSetMetaData( this.resultSetMetaDataHelper );
- }
}
}