× Heads up!

Aqua Data Studio / nhilam

Follow
IDE for Relational Databases
×
tariqrahiman reported 2010-04-30T22:23:15Z  · last modified 2010-05-04T17:01:37Z

AQReport - setPercentFormat


Dev
Fun Fun
funfun
QA
Niels Gron
NielsGron
Priority Low
Complexity Easy
Component Open API - General
Version 09.0

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  
-  -----------  ------------  -------------  ----------------------------  

Issue #4027

Closed
Fixed
Resolved 2010-05-04T17:01:37Z
 
 
Completion
No due date
No fixed build
No time estimate

About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017