Spread V11: Pasting data from a local excel file is not working in EDGE

Posted by: viswanath.malepati on 7 March 2018, 7:47 pm EST

    • Post Options:
    • Link

    Posted 7 March 2018, 7:47 pm EST

    Hi,

    We found that Pasting data from a local excel file is not working in EDGE when we have content security enabled.

    We are using content security policy enabled, with frame-src to be a acceptable from a whitelisted domains as following

    HttpContext.Current.Response.Headers.Add("Content-Security-Policy", "frame-src 'self' https://apis.google.com");
    

    When we have this in response headers of our page… copying and pasting range of cells from an excel file to spread is pasting the entire data in appropriately.

    Please find the attached files and connect it to probably IIS server to test it.

    Steps to reproduce:

    1. Extract the attached folder and link it with IIS server

    2. Browse http://localhost/test/Test.aspx in EDGE browser

    3. You will see that spread is loaded in an Iframe

    4. Now copy the range B6 to J6 and paste it in above spread

    Expected: content of 9 cells to be pasted in 9 cells

    Actual: Content of 9 cells is being pasted in 1 cell

    Note: you can see an error in the console of the browser saying:

    CSP14312: Resource violated directive ‘frame-src ‘self’ https://apis.google.com’ in Content-Security-Policy: file:///C:/Users/vmalepati/Desktop/Book1.xlsx. Resource will be blocked.

    test.zip

  • Posted 7 March 2018, 7:54 pm EST

    Adding missing Excel File:

    Book1.zip

    Note: When we have the above said content security policy in the response headers of the web page below is what happening in ClipboardPasting handler on spread.

    In the spread11.html file, i have added ClipboardPasting handler on the spread and if you notice, args.pasteData.html is an empty string “”, when this policy is enabled. On the other hand, when we dont have this content security policy enabled , we get a proper HTML for args.pasteData.html

  • Posted 9 March 2018, 1:50 am EST

    Hi Viswanath,

    I am able to replicate this issue at my end. I have escalated it to the development team for further investigation. I will let you as soon as I hear any thing on this.

    The tracking id for this issue is 255373

    Thanks,

    Deepak Sharma

  • Posted 11 March 2018, 10:53 pm EST

    Hello,

    This is found to be an issue with Edge and not SpreadJS. Developer says that it is a limitation of Edge browser which can be seen even without using SpreadJS. With iFrame Edge looses the text formatting.

    Thanks,

    Deepak Sharma

  • Posted 12 March 2018, 8:05 pm EST

    Sounds good. But same thing works perfectly with Spread V9 + edge. We are facing this problem only with Spread V11 + edge.

    May be the way it is handled is different in V9 and V11.

    So, can you suggest how to handle this situation in V11?

  • Posted 14 March 2018, 1:02 am EST

    Hello,

    To get the behavior shown by v9.0 of SpreadJS you can set the Excel paste style to off. Using the code as follows:

    spread.options.allowCopyPasteExcelStyle = false

    Thanks,

    Deepak Sharma

  • Posted 8 May 2018, 8:22 pm EST

    Hi, we tried this and its not working. Any other way to achieve it?

  • Posted 9 May 2018, 11:44 pm EST

    Hi Viswanath,

    This seems to be working absolutely fine at my end. Please refer to the attached html page and video.

    Thanks,

    Deepak SharmaSpreadJSiFrameIssue.zipspread11.zip

  • Posted 26 June 2018, 10:27 pm EST

    This seems to work fine in EDGE when we set spread.options.allowCopyPasteExcelStyle = false.

    But when we make above flag false, we are seeing same issue (data from multiple cells is being pasted in single cell) in MAC Safari and MAC Chrome.

    How to fix this?

  • Posted 27 June 2018, 10:22 pm EST

    Hi Viswanath,

    I have informed the developer this issue. I will let you know once I get an update on this.

    Thanks,

    Deepak Sharma

  • Posted 4 July 2018, 7:25 pm EST

    Hello,

    This issue is not reproducible with the latest build I tested it on a Mac machine with Safari and Chrome.

    Please test the attached sample application.

    Thanks,

    Deepak SharmaSpreadJSIFrameExcelCopy.zip

Need extra support?

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

Learn More

Forum Channels