XLSX export, issue on column representing time

Posted by: eduardo.agenciasys on 22 March 2021, 1:36 pm EST

    • Post Options:
    • Link

    Posted 22 March 2021, 1:36 pm EST - Updated 3 October 2022, 2:14 pm EST

    Hi, I am using XLSX Export to generate a report, and I am facing a issue on a column that is representing the time spent on a task.

    This is column is on the format hh:mm.

    The document is generated just fine, but the problem is on the value of the cell that contain a the value as on the image below. And this impossibilite the use of Excel functions in order to sum the time.

    We already have a colum with the sum at the end of the report, but some clients wish to edit the values on the file and see the results beeing updated.

    Thanks for any help!

  • Posted 22 March 2021, 1:39 pm EST - Updated 3 October 2022, 2:14 pm EST

    Sorry… wrong image… the correct image is this one below.

  • Posted 23 March 2021, 4:56 am EST

    Hi,

    We are sorry but we are unable to replicate the issue at our end. Could you please share a sample that replicates the issue so that we could further investigate and assist you accordingly? You may also update the following sample that we used for testing purpose:

    https://codesandbox.io/s/wijmo-starter-forked-uhk8m?file=/src/index.js

    Also, share the exact wijmo version you are using so that we may test using the same version too.

    Regards

    Sharad

  • Posted 23 March 2021, 8:24 am EST

    Hi Sharad,

    I was looking the sample used for your team, and there is a difference from mine.

    The column Time on my case represents the time spent on a task, not the time of the day, so can be greater than 24.

    This is why I have used the dataType String and not Date for my Column.

    And I am using these package versions.

    
    "@grapecity/wijmo.cultures": "5.20203.766",
    "@grapecity/wijmo.vue2.all": "5.20203.766",
    
    

    I hope that clarify your doubts. If not please let me know and I will make a reproduction.

    Thanks

  • Posted 24 March 2021, 6:54 am EST

    Thank you for the additional information. The observed behavior is expected for string columns.

    To achieve the required functionality you may override the wjXlsx._xlsx._generateCell method as demonstrated in the following sample:

    https://codesandbox.io/s/wijmo-starter-forked-x3vzc?file=/src/index.js

    Please note that the above sample is modifying an internal method which is not recommended and may not work in future releases.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels