We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Import csv

Hello, 

I'm trying to import a simple csv file, in the spreadsheet but its not working, I have this message in the console log :"synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check".

See below the code, thanks for your help.


<!DOCTYPE html>
<html>
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <meta name="description" content="Essential Studio for JavaScript">
                <meta name="author" content="Syncfusion">
                    <title>Untitled</title>
                    <!-- Essential Studio for JavaScript  theme reference -->
                    <link rel="stylesheet" rel='nofollow' href="http://cdn.syncfusion.com/13.3.0.7/js/web/flat-azure/ej.web.all.min.css" />
                    <!-- Essential Studio for JavaScript  script references -->
                    <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
                    <script src="http://cdn.syncfusion.com/js/assets/external/jquery.easing.1.3.min.js"></script>
                    <script src="http://cdn.syncfusion.com/js/assets/external/jquery.globalize.min.js"></script>
                    <script src="http://cdn.syncfusion.com/js/assets/external/jsrender.min.js"></script>
                    <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.min.js"></script>
                    <script src="http://cdn.syncfusion.com/13.3.0.7/js/web/ej.web.all.min.js"></script>
                    <!--Add custom scripts here -->
                </head>
                <body>

                    <div id='Spreadsheet'></div>
<script>
        $(function () {
            $("#Spreadsheet").ejSpreadsheet({
        allowImport: true,
        importSettings: {
            importMapper: "http://js.syncfusion.com/demos/ejservices/api/JSXLExport/Import",
            importUrl: "../data/file.csv"
        }
    });
        });
    </script>
                </body>
            </html>

1 Reply

SI Silambarasan I Syncfusion Team August 11, 2016 12:39 PM UTC

Hi Christophe, 
 
Thank you for using Syncfusion products. 
 
We have checked the reported query and we would like to let you know that, the “CSV” file import support is provided in Spreadsheet from Essential Studio 2016 Volume 2 release onwards.  Also in the given code snippet, the Script (ej.web.all.min.js) and CSS (ej.web.all.min.css) are referred from v13.3.0.7 which have cross referenced with the defined importMapper service url (http://js.syncfusion.com/demos/ejservices/api/JSXLExport/Import) since we have refreshing the online service for every release with latest version.   
 
However, we have prepared a sample to demonstrate your requirement “To import ‘CSV’ file on initial render using importUrl” with local service in v14.2.0.28 and the same can be downloaded from the following sample link.  Please refer the following code example.  
 
 
<div id='Spreadsheet'></div> 
<script> 
    $(function () { 
        $("#Spreadsheet").ejSpreadsheet({ 
            allowImport: true, 
            importSettings: { 
                importMapper: "JSXLExport/Import", 
 
                //importUrl should be defined as abosulte url eg: "http://mvc.syncfusion.com/Spreadsheet/LargeData.xlsx" 
                importUrl: "http://localhost:54039/data/file.csv" 
            } 
        }); 
    }); 
</script> 
 
 
 
 
 
Please let us know if you need any further assistance. 
 
Regards, 
Silambarasan I 


Loader.
Up arrow icon