import excel to datatable

Hi, is it possible import to datatable excel file, which was exported through webix.toExcel() method? Thanks in advance

Comments

  • Yeah

    It must be something like that :
    webix.toExcel(gridName, { name: fileName, filterHTML: true });

  • Hello!
    Yes, you can import any Excel file to DataTable by using the url property, e.g. https://webix.com/snippet/0da816e4 or by using Uploader and the parse method, e.g.: https://webix.com/snippet/a14b8563

  • Hi

    Is there a way that you can import an excel file and merge with data already in a datatable.

    https://snippet.webix.com/51dw96ip

    xsl contains only two columns.

    This example is similar to that above except that I am defining the columns up front and adding some data.

  • Hello @Gee ,
    By this snippet https://snippet.webix.com/8ampqvyc you can see that data parsed as js array and get properties as data0, data1, data2 and so on
    And it should be that the count of columns was the same as in excel

  • Hi, thanks for your help

    my problem is the json array in the original has different id fields that than those used when importing from the xsl file. Read and tried so many solutions but none seem to work, did come up with a dirty hack where I switch columns just to load the data but it does not seem right.

    https://snippet.webix.com/weiba8i8

    Also having got this working here in adding to my webix jet program it does not work at all.

    Scratching my head!!!!!

  • Further to last post, on reading the following

    https://blog.webix.com/using-excel-files-webix-widgets-demo/

    I tried using the scheme, init function

    https://snippet.webix.com/kuysfjo5

    Now the original data seems to have loaded (see empy rows ) and I can load excel file which will append to this. Still got those empty rows!!!

  • Another interesting note, in my webix jet program
    $$("dt1").parse(upload.file, "excel");
    never returns, if I put a webix.message before the call I see it but never see the one after the call. Dont see that when writing snippets.

    The plot thickens.

  • In case of any "mystic" issues, be sure to add debug:true to the app's config.
    Without such option, errors inside of promises will be silently ignored.

    In your case, some common js error occurs during parse command execution

  •             System.Data.OleDb.OleDbConnection MyConnection ;
                System.Data.DataSet DtSet ;
                System.Data.OleDb.OleDbDataAdapter MyCommand ;
                MyConnection = new System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;Data Source='c:\\csharp.net-informations.xls';Extended Properties=Excel 8.0;");
                MyCommand = new System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", MyConnection);
                MyCommand.TableMappings.Add("Table", "TestTable");
                DtSet = new System.Data.DataSet();
                MyCommand.Fill(DtSet);
                dataGridView1.DataSource = DtSet.Tables[0];
                MyConnection.Close();
    

    http://csharp.net-informations.com/excel/csharp-excel-oledb.htm

Sign In or Register to comment.