How to use setPercentFormat to apply to a purticular column ? I applied string pattern #,##0.##% but it doesnt seem to have any effect on the number column and will it automatically take the number column by default without specifying the column index ?
I wanted to apply on frieght which is a number column. The script is given below.
void setPercentFormat(String pattern) throws Exception
// create a new dataset
var ds = aqua.data.newDataSet("ShipCountry,text,freight,number,ShipCity,text,OrderDateTime,datetime");
ds.addRowWithValues("US", 100,"Santa Clara", "1996-09-18:12:12:12");
ds.addRowWithValues("UK", 10.1111111,"San Jose", "2000-09-18:12:12:12");
ds.addRowWithValues("Japan", 200.98765,"Sunnyvale", "1996-08-08 00:00:00.0");
ds.addRowWithValues("Canada", 20.555555555,"Aliso Viejo", "2002-09-18:12:12:12");
ds.addRowWithValues("France", 300.88888888,"Orange County", "2003-09-18:12:12:12");
ds.addRowWithValues("Germany", 30.87876878,"Sacramento", "Fri Apr 30 14:40:29 PDT 2010");
// create a new Report
var rep = aqua.report.newReport();
// add settings to the report
var repset = aqua.report.newReportDataSetSettings();
repset.setTitle("All Freight Details of Ports");
repset.setHeaderDivider(1);
repset.setShowHeaderDivider(true);
repset.setPercentFormat("#,##0.##%");
// add the DataSet to the Report
rep.addDataSet(ds, repset);
// print with new settings
aqua.console.print(rep.renderText());
aqua.response.write(rep.renderHtml());
o/p
= =========== ============ ============= ============================
ShipCountry freight ShipCity OrderDateTime
= =========== ============ ============= ============================
1 US 100 Santa Clara 1996-09-18:12:12:12
2 UK 10.1111111 San Jose 2000-09-18:12:12:12
3 Japan 200.98765 Sunnyvale 1996-08-08 00:00:00.0
4 Canada 20.555555555 Aliso Viejo 2002-09-18:12:12:12
5 France 300.88888888 Orange County 2003-09-18:12:12:12
6 Germany 30.87876878 Sacramento Fri Apr 30 14:40:29 PDT 2010
- ----------- ------------ ------------- ----------------------------
setPercentFormat(pattern) has nothing to do with any APIs used in your test script. It is only affected by the following two APIs:
setShowCellPercentageByColumn(boolean flag)
setShowCellPercentageByRow(boolean flag)
I updated setPercentFormat(pattern) javadoc and tied it to the above two APIs.
Updated javadoc is available as revision 14217 of trunk/ADS.
Resolved in Java Docs Version: 9.0.0-dev12.83 Build #: 14217.
Resolved in Java Docs Version: 9.0.0-dev12.83 Build #: 14217.
Issue #4027 |
| Closed |
| Fixed |
| Resolved |
Completion |
| No due date |
| No fixed build |
| No time estimate |
setPercentFormat(pattern) has nothing to do with any APIs used in your test script. It is only affected by the following two APIs:
setShowCellPercentageByColumn(boolean flag)
setShowCellPercentageByRow(boolean flag)
I updated setPercentFormat(pattern) javadoc and tied it to the above two APIs.
Updated javadoc is available as revision 14217 of trunk/ADS.