Import doesn't keep the format number.

I've been with a problem with the spreadsheet component. When I export a file and then I want to import that same or import another file created with excel the component doesn't keep the number format.
You can see the problem in this link, you can export the file and then import the same file. When the file is imported the file misses the number format.



  • Hey @JamesHernandez, unfortunately this is a feature that isn't yet implemented, so I'm afraid there is no workaround for this for the time being. There is a chance this will get updated at some point in the future.

  • Hi @Dzmitry, thanks for your soon answer. Is there any way of maintaining my data with number format? I don't know. maybe save the spreadsheet configuration and load it after?

  • Hey again @JamesHernandez, the format data is actually there, it's present, but it just doesn't get handled in any way on our side in any shape or form. To circumvent this, you can do the following (this is just a short version of what's going on in the snippet below):

    1. Get the number formats on data parse
    2. Convert cell names from that data to coordinates (i.e. A1 to [1, 1])
    3. Push your data in the format of: [x, y, format]
    4. Use setFormat to apply the formatting

    The end result will look something like this:
    I'd also like to point out that this will slow down the importing a fair bit, but this is pretty much the only way to do this for now. Hope this proves helpful.

  • @Dzmitry thanks, The solution has given me work perfectly

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!