Initial Release
Added use of the fileserver and csvgen projects to demonstrate how to get a generated xlsx file
A simple example of using the python openxl library to export a request to an excel file
IRIS for UNIX (Ubuntu Server LTS for x86-64 Containers) 2021.2 (Build 649U) Thu Jan 20 2022 08:53:15 EST
If ZPM the current instance is not installed, then in one line you can install the latest version of ZPM.
zn "%SYS" d ##class(Security.SSLConfigs).Create("z") s r=##class(%Net.HttpRequest).%New(),r.Server="pm.community.intersystems.com",r.SSLConfiguration="z" d r.Get("/packages/zpm/latest/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c")
If ZPM is installed, then ZPM can be set with the command
zpm:USER>install eap-sql2xlsx
Make sure you have git and Docker desktop installed.
Clone/git pull the repo into any local directory
$ git clone https://github.com/SergeyMi37/eap-sql2xlsx
Open the terminal in this directory and run:
$ docker-compose build
$ docker-compose up -d
...
$ docker-compose exec iris iris session iris
USER>zpm "install csvgen" ... USER>do ##class(community.csvgen).GenerateFromURL("https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv",",","Data.Titanic")
Class name: Data.Titanic
Header: PassengerId INTEGER,Survived INTEGER,Pclass INTEGER,Name VARCHAR(250),Sex VARCHAR(250),Age INTEGER,SibSp INTEGER,Parch INTEGER,Ticket VARCHAR(250),Fare MONEY,Cabin VARCHAR(250),Embarked VARCHAR(250)
Records imported: 891USER>do ##class(dc.msw.py.xlsx).sql2xlsx("select * FROM Data.Titanic","","/usr/irissys/mgr/Temp/titanic.xlsx")
Save into /usr/irissys/mgr/Temp/titanic.xlsx rows: 891
USER>zpm "install fileserver"
...
USER>do ##class(Fileserver.File).AddFile("/usr/irissys/mgr/Temp/titanic.xlsx")
http://localhost:52663/fileserver/files