Copy Pasting Issue

Posted by: mayank.singh on 29 March 2023, 6:52 am EST

  • Posted 29 March 2023, 6:52 am EST - Updated 29 March 2023, 7:04 am EST

    Hi Team,

    We are using the SpreadJS: 16.0.2 in angular applictaion.

    While copy/pasting cells value in spread using the keyboard command (Ctrl+c/Ctrl+v) its not pasting correctly for example

    If I try to copy figures, from Excel, that has more decimals than Excel can currently show

    then only the figures that are visible gets pasted.

    Could you please provide the solution for this.

    for mor info please refer attached video

    FD-1652.zip

  • Posted 30 March 2023, 8:54 am EST

    Hello,

    This is by design When values in MS Excel are copied, they are copied in text and html format. In html format, an html table is utilized so that formatting and styling can be maintained. SpreadJS parses the html format of copied values by default.

    When you copy a cell which is formatted and not shown completely in MS Excel cell, then the corresponding copied html table contains ##### values instead of the actual value. That is why, values are not pasted properly when pasted in SpreadJS.

    You can set spread.options.allowCopyPasteExcelStyle property of the spread to “false”. This will cause the SpreadJS to parse the text values(actual) of the copied cells from Excel instead of html format. This way values will be pasted properly.

    Please note that when the spread.options.allowCopyPasteExcelStyle property is set to false, then formatting and styling will not be pasted while copying from Excel and pasting in SpreadJS.

    Please refer to the attached sample.

    Sample: https://jscodemine.grapecity.com/share/9L5bI2-n8E_cVMcrt5Iyjg/?defaultOpen={"OpenedFileName"%3A["%2Findex.html"%2C"%2Fsrc%2Fapp.component.ts"%2C"%2Fsrc%2Fapp.component.html"]%2C"ActiveFile"%3A"%2Fsrc%2Fapp.component.html"}

    Doc reference

    spread.options.allowCopyPasteExcelStyle: https://www.grapecity.com/spreadjs/api/v16/interfaces/GC.Spread.Sheets.IWorkBookDefaultOptions#allowcopypasteexcelstyle

Need extra support?

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

Learn More

Forum Channels