ParamQuery grid support forum

General Category => ParamQuery Pro Evaluation Support => Topic started by: gtwangi on March 28, 2019, 04:18:46 pm

Title: Leading '0' values are not exported properly.
Post 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?


Title: Re: Leading '0' values are not exported properly.
Post by: paramvir on April 09, 2019, 01:32:22 pm
It can be done by adding dataType: 'string' and format property to the column.

Code: [Select]
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:

Code: [Select]
                       { title: "Freight", width: 120,
format: function(val){
return " "+val;
},
//dataType: "float",
dataIndx: "Freight"
},
Title: Re: Leading '0' values are not exported properly.
Post by: gtwangi on April 16, 2019, 08:10:06 pm
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?




Title: Re: Leading '0' values are not exported properly.
Post by: gtwangi on April 22, 2019, 04:14:37 pm
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?