Create an AquaScript that contains the following code snippet:
// query a data set var dataSet = conn.executeSnapshot(sql); // create a report dataset settings var settings = aqua.report.newReportDataSetSettings(); settings.setColumnNumericFormat(1,"$#,##0.00"); settings.setColumnDateTimeFormat(2, "MMM dd, YYYY hh:mm:ss a"); //save as excel file using the report settings dataSet.saveAsExcel2007("<path to file>", settings, null);
There are three parts to this issue:
1. The dataSet.saveAsExcel2007 (i.e. CoreDataSet#saveAsExcel2007 Open API) implementation does not generate an Excel workbook.
2. The generated Excel workbook does not export the "$#,##0.00" and "MMM dd, YYYY hh:mm:ss a" numeric and date/time formats.
3. We need to add new Aquascript OpenAPIs to allow users to customize data cell foreground and background colors when exporting to Excel.
![]() |
1 KB
|
151 KB
|
139 KB
|
139 KB
1. The dataSet.saveAsExcel2007 (i.e. CoreDataSet#saveAsExcel2007 Open API) implementation does not generate an Excel workbook.
The reason for the above is that the data set object created is CoreDataSetBase which has empty saveAsExcelXXXX implementation. CoreDataSet (subclasses from CoreDataSetBase), which contains actual implementation, should be created instead. This is likely broken by code refactoring done on 2/21/13 SVN r31419.
2. The generated Excel workbook does not export the "$#,##0.00" and "MMM dd, YYYY hh:mm:ss a" numeric and date/time formats.
Looks like we have never supported the above. We will add this by using the AQExcelUtil Java-to-Excel number and date/time format conversion methods.
3. We need to add new Aquascript OpenAPIs to allow users to customize data cell foreground and background colors when exporting to Excel.
The following 16 Open APIs have been created:
public void setColumnForegroundColor(String name, int red, int green, int blue) throws Exception; public void setColumnForegroundColor(int index, int red, int green, int blue) throws Exception; public void setColumnForegroundColor(String name, String hexCode) throws Exception; public void setColumnForegroundColor(int index, String hexCode) throws Exception; public int getColumnForegroundColorRGB(String name); public int getColumnForegroundColorRGB(int index); public String getColumnForegroundColorHexCode(String name); public String getColumnForegroundColorHexCode(int index); public void setColumnBackgroundColor(String name, int red, int green, int blue) throws Exception; public void setColumnBackgroundColor(int index, int red, int green, int blue) throws Exception; public void setColumnBackgroundColor(String name, String hexCode) throws Exception; public void setColumnBackgroundColor(int index, String hexCode) throws Exception; public int getColumnBackgroundColorRGB(String name); public int getColumnBackgroundColorRGB(int index); public String getColumnBackgroundColorHexCode(String name); public String getColumnBackgroundColorHexCode(int index);
@qa - please perform the following new functionality and regression tests:
- AQDataSet#saveAsExcel2003 and AQDataSet#saveAsExcel2007 Open APIs on ADS and ADServer
- Export number and date/time formats set by AQDataSetSettings#setColumnNumericFormat and AQDataSetSettings#setColumnDateTimeFormat, with and without row number column (using AQDataSetSettings#setShowRowNumber)
- Export to Excel using the new OpenAPIs to customize column foreground and background colors. Verify the new API documentation.
- Export with other AQDataSetSettings attributes and export with charts continue to work as before.
Verified all scenarios in ADS v19.0.0-alpha-23.
@deepthi: Please see the attached screenshot for an Exponential format which works fine.
Verified all scenarios in ADS v19.0.0-alpha-23.
@deepthi: Please see the attached screenshot for an Exponential format which works fine.
3. We need to add new Aquascript OpenAPIs to allow users to customize data cell foreground and background colors when exporting to Excel.
3. We need to add new Aquascript OpenAPIs to allow users to customize data cell foreground and background colors when exporting to Excel.
Issue #15284 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build 18.0.13-8, 19.0.0-alpha-28 |
No time estimate |
2 issue links |
breaks #15290
Issue #15290getAsExcel2003 gives Null Pointer Exception |
breaks #15289
Issue #15289AQExcelSpreadsheet to insertPivotTable gives Null Pointer Exception |
The reason for the above is that the data set object created is CoreDataSetBase which has empty saveAsExcelXXXX implementation. CoreDataSet (subclasses from CoreDataSetBase), which contains actual implementation, should be created instead. This is likely broken by code refactoring done on 2/21/13 SVN r31419.
Looks like we have never supported the above. We will add this by using the AQExcelUtil Java-to-Excel number and date/time format conversion methods.
The following 16 Open APIs have been created:
@qa - please perform the following new functionality and regression tests:
- AQDataSet#saveAsExcel2003 and AQDataSet#saveAsExcel2007 Open APIs on ADS and ADServer
- Export number and date/time formats set by AQDataSetSettings#setColumnNumericFormat and AQDataSetSettings#setColumnDateTimeFormat, with and without row number column (using AQDataSetSettings#setShowRowNumber)
- Export to Excel using the new OpenAPIs to customize column foreground and background colors. Verify the new API documentation.
- Export with other AQDataSetSettings attributes and export with charts continue to work as before.