Author Topic: Get data with format  (Read 3777 times)

resolvecomputing

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 40
    • View Profile
Get data with format
« on: March 06, 2018, 05:16:21 pm »
Can I get the data with format from table?
And when I set format in pivot, default it not show format and when I change filter it's show the format.
Thanks!
« Last Edit: March 06, 2018, 05:22:55 pm by resolvecomputing »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6113
    • View Profile
Re: Get data with format
« Reply #1 on: March 07, 2018, 06:41:45 am »
Sorry the question is not clear enough.

Can you please elaborate it with an example.

Thanks

resolvecomputing

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: Get data with format
« Reply #2 on: March 07, 2018, 07:31:50 am »
1. I mean, the normally source data for column "abc" is 1000000, and after that I set format for "abc" is "#,###.00". So how can I get data from paramquery with result is 1,000,000.
2.  The second question is: I used pivot and set format for column, but when loading the first time it's not show the format. I example: source data is 1000000 and I set format is  "#,###.00" when loading the first it's show 1000000 but when I drag and drop pivot the format come 1,000,000.
Can you help me solve that problems.
Thanks!

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6113
    • View Profile
Re: Get data with format
« Reply #3 on: March 07, 2018, 06:18:27 pm »
1. Data and format are kept separate, format is applied only when data is displayed i.e., in grid or export as Excel. When grid data is exported as json data, format is not applied.

Format can be applied manually by iterating through rows and call pq.formatNumber method on each value.

https://paramquery.com/pro/api#method-formatNumber

2. I'm able to reproduce the issue (unable to set format dynamically after initialization to a pivoted column), would let you know once its fix is available

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6113
    • View Profile
Re: Get data with format
« Reply #4 on: July 24, 2018, 11:10:34 am »
2nd issue is fixed in v5.2.0