Pasting dates from excel files to spreadjs

Posted by: ablsoft on 15 May 2019, 10:18 am EST

  • Posted 15 May 2019, 10:18 am EST

    Hi

    I am copy pasting values from an excel document to a SpreadJs object.

    In the case of dates, these are being pasted but they look like a number instead of a date on the spreadjs cell. Is there any suggestion on how to control the dates coming from excel to a SpreadJS object by copy pasting?

    Note: we are literally using copy / paste operations.

    We attempted to control the final result with an event, but it did not work, for instance: ValueChanged, EditEnded and CellChanged, but those are not triggered when pasting, only when typing.

    Thanks!

  • Posted 15 May 2019, 7:43 pm EST - Updated 3 October 2022, 1:31 am EST

    Hi,

    We are sorry but we are unable to replicate the issue at our end. Here are steps we followed while trying to replicate the issue:

    1). Create a new excel file and enter date in one of its cells

    2). Copy the value using ctrl+c

    3). Open the spread web designer sample(https://www.grapecity.com/demos/spread/JS/WebDesigner/content/index.html) and paste the value in spread using ctrl+v.

    We have also attached a gif with our observation, please have a look at it and let us know if we need to follow some other steps in order to replicate the issue.

    Regards

    Sharad

  • Posted 24 July 2019, 3:33 pm EST

    Hi, we are revisiting this issue since it is now critical for our customer.

    Please, import the document inside the sample.zip folder, use the sampleapp.html to import it into SpreadJS, then, paste any date from some excel document to the imported document to see that it converts the date to a number.sample .zip

    See a video of the situation: https://www.screencast.com/t/zR6r82YLt

    Thanks!

  • Posted 25 July 2019, 6:33 pm EST

    Hi,

    The issue seems to be fixed in the latest release. Please test with the latest spread build 12.2.0 and let us know if the issue persists for you?

    Regards

  • Posted 29 July 2019, 2:29 pm EST

    Hi,

    Thanks much, two things to point out:

    1. it seems that it works better in 12.2.0, but now it pastes the date with a time next to it, that is a bit better but it would be ideal to have the same format as in the excel file.
    2. One extra issue is that when pasting a cell with formula from an excel document, only the final value is pasted and the formula is lost.

      If there is not an official way to control how these values are pasted, can you suggest any way to hook a function to control programmatically what´s being pasted?

      For instance, if we copy a whole column from excel, a combination of values, dates, numbers or formulas could come from the excel document, we would need to make sure each type of value being pasted is properly entered and preserved in the spreadJS object, how can we intercept this content prior to be pasted so we transform it as needed? (assuming SpreadJS can not be configured somehow to proper format dates or preserve incoming formulas).

    Thanks,

    PD: this is very critical for us now, any help is truly appreciated.

  • Posted 30 July 2019, 10:03 pm EST

    Hi,

    1). We are able to replicate the issue at our end and hence we have forwarded it to the concerned team for further investigation of the issue(Internal tracking ID: SJS-1190).

    2). This is a limitation, we cannot preserve the formula while pasting data from excel because to support excel style copy paste we get the rich text content from the clipboard and excel only copies the final computed value as the rich text on the clipboard and not the actual formula.

    Spread automatically transforms the pasted data according to its type, so we do not need to explicitly transform the data type. Please let us know if you face any issues with this behaviour and we will look into it.

    Further, if you still need to get what data is pasted into the spread, then you may handle the clipboardPasting event and perform the required task.

    API reference: http://help.grapecity.com/spread/SpreadSheets12/webframe.html#SpreadJS~GC.Spread.Sheets.Events~ClipboardPasting_EV.html

    Regards

  • Posted 16 August 2019, 5:18 am EST

    Hello,

    This issue has been resolved in our V12.2.2 release:

    http://cdn.grapecity.com/spreadjs/12.2.2/Files/SpreadJS.Release.12.2.2.zip

    Regards

  • Posted 7 February 2020, 8:30 am EST

    Thanks much, we will give it a try

Need extra support?

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

Learn More

Forum Channels