My company is using version 14.2. The following is a description of what we need to do. I have 2 questions regarding the following:
1. Can it be done?
2. Are Excel xlsx formatted files supported
What we need to do.
1. Client-side we need to read either an xls for xlsx formatted Excel file.
2. We need to push the data in the Excel file to the server for further processing, but before we do we need to review each row/cell in the worksheet and perform some validation. If any problems are found with the file, we will inform the user and halt processing.
3. One column in the Excel file is reserved to report back to the user the results of the validation processing. So, for each row that has one or more problem, we will update the "status" cell to describe the problem. We then want to export the file back to the local machine where the user can review the results of the validation or forward to another user.
If we can easily import the Excel file into an igGrid and validate the data against the grid, that would be fie, but we would need to be able to autogenerate the grid based on the columns defined for the Excel file and be able to easily export the igGrid contents back to an Excel file.
Can all of this be done client-side, or will we require server-side processing as well?
Hi and thank you for posting in the Infragistics community !
I have read carefully your requirements and I am glad to tell you that the desired can be achieved using our Excel Client Side library and igGridExcelExporter - both are completely client side solutions and will enable you to load excel files, modify them on the client, populate igGrid with data from the excel, or use an existing igGrid and export the data to excel file and save the file locally.
Please see a sample attached that demonstrates how you can browse the local machine for an excel file - once you upload it the data will be used to populate an igGrid. The columns are defined based on the excel file, so you can either use the defined columns and modify them or leave the grid autogenerate them based on the data.
You can also either modify the worksheet via the Excel library or use the igGridUpdating feature to make changes. Once these changes are complete the modified worksheet can be saved locally to the machine.
Please review the sample to see if this would work for you (please note that the data in the excel should staart from the first row and first column - this is the logic in the demo used, but it can be modified for more complex scenarios). Please also tell me what kind of validation you would like to perform and I will be able to modify the sample to fully meet your requirements.
Looking forward to hearing from you.
Unfortunately, the sample didn't work. The link for the file to download, and the links for the js and css files, would not resolve.
So I pointed the js and css to the version 14.2 files we have (we are not planning to use 15.2 at the moment because it is not backward-compatible with 14.2 for all functionality. i.e. some of the options and methods are different from what we use today and we don't have the time right now to go back and re-write with more testing).
Unfortunately, this also failed when method $.ig.excel.Workbook.load was called. This triggered the error function function error(er) which also failed with the error "er.message is not a function".
My assumption is that the Excel support for 14.2 is different from what is available for 15.2 and I can't find any documentation to explain how to use the 14.2 versions.
I think this would have been great if it had worked.
Still pointing to the 14.2 version of the Infragistics code, I fixed the reference in the error function to er.message() since er.message is a property of the er object, not a function.
Now upon calling $.ig.excel.Workbook.load I get the following error message
er: TypeError: Cannot read property 'runOn' of undefined at $.ig.util.defType._a3 (http://rwsrv2012dev-1.spsinc.local/_layouts/15/SPS/Scripts/infragistics.excel.js:26:673) at $.ig.util.defType._a2 (http://rwsrv2012dev-1.spsinc.local/_layouts/15/SPS/Scripts/infragistics.excel.js:25:14757) at $.ig.util.defType._a1 (http://rwsrv2012dev-1.spsinc.local/_layouts/15/SPS/Scripts/infragistics.excel.js:25:14669) at $.ig.util.defType._load1 (http://rwsrv2012dev-1.spsinc.local/_layouts/15/SPS/Scripts/infragistics.excel.js:25:14590) at $.ig.util.defType.load (http://rwsrv2012dev-1.spsinc.local/_layouts/15/SPS/Scripts/infragistics.excel.js:25:14174) at Class.ret [as load] (http://rwsrv2012dev-1.spsinc.local/_layouts/15/SPS/Scripts/infragistics.core.js:216:27307) at FileReader.fileReader.onload (http://rwsrv2012dev-1.spsinc.local/OrapWebApiServices/importData.html:77:24)
Any idea why this error would occur?
It would appear that for 14.2 the er.message is a string, while for 15.2 it is a function.
Hello,
The issue seems to be caused by bug in the excel library in 2014.2 version. The bug is fixed, but since the 14.2 version was still a CTP the fix is not introduced to 14.2, but only to 15.1 and 15.2 This is why the sample works with 15.1 and 15.2 but errors are thrown when using 14.1
Let me note that the CTP version are released with the only goal of technical preview in a local environment and are not supposed to be used in production. I strongly recommend upgrading your app to 15.1 or 15.2. Please let me know if you would need any assistance doing it.
I will further investigate the issue regarding 14.2 and try to get the sample working for it. I will keep you posted,
Hi,
I have missed to point the references to the correct cdn, this is why you had issues, sorry for that. Every other time you can see the latest references if you go to any random sample at igniteui.com. Anyway I have corrected those and pointed them to latest 2015.1 and it worked fine too. Please see the modified sample attached and let me know if you have any issues with it - I will be glad to help you with it.
Thank you for your patience!
In 14.2 the Client-side excel library was CTP and it is possible to have some incorrect behaviors and not to be very stable. Due to our policy we provide fixes for the current volume release and the previous one. (refer to http://ko.infragistics.com/support/product-lifecycle). This is fixed in the latest version of 15.1 and 15.2. What I can suggest you is to upgrade to one of the latest service releases either of 15.1 or 15.2.
Thank you for the understanding in advance.
I've attached an html file I used to demonstrate the problem.