K2NE / K2NEServiceBroker

The k2NE Service Broker
12 stars 19 forks source link

Excel Import exception error: unable to read from Excel file #114

Open EPuigdemont opened 6 years ago

EPuigdemont commented 6 years ago

I built the project in VS 2017 successfully on my personal computer, the service was to be installed on a server instance (running K2 Five 5.0002.1000.2), after running the powershell command and registering the broker I have created the service instance and SmartObjects, however whenever I try to import any Excel file I obtain an exception error: Attached file, exceptionerror.txt

I lack the knowledge to understand where exactly the problem is. Could the service not have been registered properly? Missing files?

cyclops1982 commented 6 years ago

Hi,

The error message has this part in it: Could not load file or assembly 'DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. 0 InnerException.StackTrace:

I think you need to install openXML to make this work... https://www.nuget.org/packages/DocumentFormat.OpenXml/

EPuigdemont commented 6 years ago

I installed the nuget package and recompiled the project. I tried running the installer again on the target environment but the issue persists. Is there a specific procedure to clean install the service broker?

cyclops1982 commented 6 years ago

You'll have to put the DocumentFormat.OpenXml components on the K2 server. You can either add the assemblies in the servicebroker folder or install the openxml SDK on the k2 server.

EPuigdemont commented 6 years ago

I moved the entire project folder to the target environment and tried to run the installer, when doing so the powershell window shows the following sin titulo-2

I still have the issue when trying to execute the SmartObject, I also tried installing the OpenXML SDK from the Microsoft page and copying the DocumentForma.OpenXML.dll files to the broker folder on the target environment C:\Program Files\K2\ServiceBroker.

Remeber, this is a K2 Five installation from scratch, it's not upgraded from 4.7. Is there anything special I need to do when compiling the project if the target is K2 Five? Is K2 Five even supported at all?

Thanks

cyclops1982 commented 6 years ago

The powershell just copies and registers the service type. it is currently made for k2 4.7 only and that's the error that you're seeing. For k2 we need to update the script. What the script does can easily be done manually.

In any case, that you get the error message means that it's installed. The error message is a dependency and if the openxml SDK install on the server itself didn't help, then i'm not sure what is exactly missing.

EPuigdemont commented 6 years ago

So I can install the service manually by extracting the data into the K2 brokers folder, correct? If I copy and paste the files from the release folder into the C:\Program Files\K2\ServiceBroker folder, as well as put the DocumentFormat.OpenXML.dll to the C:\Program Files\K2\ServiceBroker folder, since the service type is already registered, now I would only need to refresh the service, recreate the SmartObjects and then it should work.

Well it seems like we made some progress, the OpenXML issue has disappeared and now has been replaced by the current attached error log: exceptionerror2.txt exceptionerror3.txt

I have tried to load a simple table in XLS, XLSX and XLSM formats. Is the broker only compatible with XML files?

cyclops1982 commented 6 years ago

@EPuigdemont The exceptionerror2.txt clearly states an error message: 'A sheet with name "a" was not found' For the exceptionerror3.txt, i've tried to convert your base64 output to a file and open it, but that fails. Are you sure you are uploading an excel file?

EPuigdemont commented 6 years ago

Yes, I am uploading an excel file that I made myself which contains a couple columns and rows. As I understand it, the broker can read any excel file, right? test.xlsx

Can this be related to the Excel version? Should I export the Excel files in a specific format?

EPuigdemont commented 6 years ago

Any idea on this? I have attempted to upload files in different formats (XLS, XLSX, ODS, XLSM) and all come up as corrupted data.