Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: How to format numbers in table export to cde?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2016
    Posts
    7

    Arrow How to format numbers in table export to cde?

    Hi,

    I have been trying to apply formatting to numbers being exported to csv without any success.
    When exporting to xls numbers are exported with the right format (without my intervention), but unfortunately the requirement given to me is to export to csv.

    Basically I have a Table Component and an Export Popup Component and in this last component I have selected csv as export format.
    When I load the dashboard and hit export all numbers are exported, e.g. without thousands separator.

    So far I have been able to format all numbers displayed in the dashboards by using the FormatProvider and using info on these pages:

    - Format Number and Date
    - Pentaho CCC Chart Label Formatting
    - Number formatting issues in CDE

    But I have had no luck applying any formatting to the csv export.
    I am guessing that the csv is actually generated server side and there might be nothing I can do from CDE to format the numbers in a specific column from CDE.

    So yesterday I started looking at the code of CDF 6.1.0.13 - the version I am using - (I am assuming that might be where the code for the export may be found)...

    ...and finally found these java classes that seem likely candidates for being the export logic.

    So here are some questions:

    - is there any way to format the values in a column somehow from CDE?

    - in case there is no way in CDE, would I have to modify the ExportCSV.java to modify csv export behavior?

    - do any instructions exist on how to set up a development environment so I can modify these files, test changes and offer them for integration into the master branch?

    Thanks in advance!
    Last edited by kahennig; 04-25-2017 at 01:03 PM.

  2. #2
    Join Date
    Aug 2013
    Posts
    25

    Default

    Hi, I have a similar problem. Only it is for me with the xls export :-) The default seems to do a %.2f for numeric data and I want to change that for some fields. Did you solve your issue?
    It's good to remember you are exporting the underlying data, not the data in the table. I guess with some javascript code at the exportComponent you can have access over the output. But if/where that is documented.....

  3. #3
    Join Date
    Nov 2011
    Posts
    1,229

    Default

    if you're using excel, you can define an excel file as a template for exporting. If you format the columns in that excel file, exporting the data will format the data accordingly.
    Pedro Vale
    --
    CTools Product Development
    http://www.webdetails.pt

  4. #4
    Join Date
    Mar 2016
    Posts
    7

    Default

    Excel is now starting to be an option for me... I will try this thanks!!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.