Hi Dojo,
I need to develop a connector which reads and writes to an excel file. I can't use Microsoft COM objects because the customer doesn't have Microsoft Office installed. I've tried multiple NuGet packages, but they need licenses to be used commercially.
Does anyone have a suggestion on how to approach this?
Firstly I would say, do you really have to? What is the use case? Is this the best solution? Just being cautious, because personally I'm not a big fan of that as sometimes this can be a bit of a rabbit hole that you go down into (i.e. an excel sheet is not a database, and it is designed for humans to play around in).
Also not sure if you are referring to writing into an existing excel file with existing content, or being able to deliver data into a file that can be consumed with Excel. Because if the latter would the case, I would simply generate a CSV file with the data. That will open up just fine in Excel and people can then take that forward and do what they want to do.
Hi Benjamin – thank you for that clarification and the context of this question. I might still be missing some of the finer details, but it sounds like you are dealing with a data source which is too large to throw all the data into the element. And therefore you want to take a portion of that and store it separately (and currently you are considering an Excel file for that). Some, a portion of that, you still want to synch to a table in the element so that it is available in that element. And you would choose for an Excel file (and probably store it in the docs section of the element), probably because you want the user to have the option to see the full data set if he wants. If I understood everything correctly.
Based on that, I’m wondering if you should consider the use of a Logger Table (https://docs.dataminer.services/develop/devguide/Connector/AdvancedLoggerTables.html). This allows you to store very large amounts of data straight into the data storage of DataMiner and not hold it in memory. This sounds to me like a more robust solution as compared to storing it in a file. You would then also have the option to read back certain data from that, and use it again in the driver (either raw records or aggregated data derived from the raw data, e.g. just to name an example a count of the number of lines in there). There is also a native UI in your element that is available if you have stored data in a logger table, which allows the user to interact with that data (e.g. perform a search for specific records).
Have you looked into a Logger Table as a possible solution?
Yes, you’re right about everything, except for the data source being very large. We have around 800 rows in the table and that number is persistent. I did not know about logger tables, though. I will discuss it with my TAM. Thank you.
Hello Ben, in our use case, we’re separating data from a rather large json object into 2 parts. One part is being frequently updated and polled so we left it in the json object. The data which is “static” (kind of) is moved to a excel file and polled less frequently, where a dataminer table and xlsx file are synchronized (changes in one reflect on the other), hence the need for writes to the file.
CSV file isn’t very readable for that purpose, so that’s why we chose excel.