February 20, 2021, 4:40am
I am trying to figure our how to export data from a power table to excel formatted as an excel table, any help would be apprecated.
What version of Ignition?
I know the topic is different, but trust me.
Apache POI libraries are included with Ignition. At the time I was only needing to read files, so xlrd was all that was necessary.
I’m just starting to dig into POI, myself, but here’s a start:
EDIT 2021-08-23: Updated to allow JsonDataSets. Changed to allow for a ByteArray output instead of writing to a file.
def datasetToExcel(dsIn, fileName = '', sheetName = 'Sheet1'):
''' Convert a dataset to Excel
dsIn: The dataset to convert. Valid types are:
February 23, 2021, 3:36pm
def datasetToExcel(dsIn, fileName, sheetName = ‘Sheet1’): import org.apache.poi.ss.usermodel.Cell as Cell import org.apache.poi.ss.usermodel.Row as Row import org.apache.poi.ss.usermodel.Sheet as Sheet import org.apache.poi.ss.usermodel.Workbook as Workbook import org.apache.poi.xssf.usermodel.…
Thank you. I am unfamiliar with apache.poi so I need to do some research, but at least I have a place to start.
@Derekr, may I know that did you solve the problem that you mentioned above because I also studying this thread which recommend by @JordanCClark and I also unfamiliar with apache.poi so if you had done some script. Hope you can share with me for refer purpose.
Thanks in advance
August 5, 2021, 7:56pm
Sorry Tohhy I did not. The solution was too complicated so we dropped it