ParamQuery grid support forum
General Category => ParamQuery Pro Evaluation Support => Topic started by: gtwangi on March 28, 2019, 04:18:46 pm
-
When exporting leading '0' values(ex. '012345') by using 'exportData' method, the leading zero are deleted in Excel(12345 instead of '012345').
in pqgrid ->> in excel
'012345' ->> 12345
Is there way to preserve the leading zero while exporting to excel?
-
It can be done by adding dataType: 'string' and format property to the column.
format: function(val){
return " "+val;
},
For example, it can be verified by replacing Freight column definition in this demo ( https://paramquery.com/pro/demos/export ) with this:
{ title: "Freight", width: 120,
format: function(val){
return " "+val;
},
//dataType: "float",
dataIndx: "Freight"
},
-
I appreciate your help.
The solution you provided doesn't work on v5.5.0 (I'm using). it probably works well above v5.6
1.
Is there a solution for v5.5.0?
2.
How compatible are v5.5.0 and v5.6.1? which part of code should I modify when upgrading my app to v5.6.1?
-
There is another issue about exporting data.
Negative number is exported as number on v5.5 properly. but after I upgraded pqgrid version to 5.6.1, negative number is exported as text.
(https://postfiles.pstatic.net/MjAxOTA0MjJfNjUg/MDAxNTU1OTI5NjE3MjQ1.Z2NbqBH-e6KlmgJbX0zZxPxcAGfHhSMkPabcOsT1E6Ig.C4F6bWFndqBgn648l-KIx0fD5IyB3cCXk3W35_Z10yYg.PNG.gtwangi/%EA%B7%B8%EB%A6%BC1.png?type=w773)
How I could export this as number?