Article
· Aug 14, 2021 2m read

Deploy to production module to convert query results to xlsx file based on python openpyxl library

Continuing the description of work on the use of the openhl python module in productive mode.

Since the version of iris with Embedded Python, does not yet have a final release, it is already necessary to use it in production now. We decided to back up the service for exporting requests to a xlsx file on a separate server, and save the query result in a global in a separate database.

This database was made networked, local for the service server and remote for the product server. The communication between the prod server and the service was implemented using a rest service.

So: on the server in the client application, the user orders a large report. The report is generated in the background and saved in the global.
On the remote database, the rest service is called with a full reference to the global as a parameter. The service starts in the background and exports a file to an Excel file and, after that, signals a call to the rest service with a link to the generated file. Having received the message, the service on the production server archives the Excel file and sends it by mail to the client.
And here we must not forget that the remote and local database must be protected by a single resource, the privileges for which must be assigned to the user for which the file is generated.

In this way, we have replaced %SYS.ZENReportExcelExporter on the product server.
In the future, as a development of this solution, we plan to replace sending files by mail to the link panel of generated files for downloading by the user independently upon notification of readiness

Discussion (0)2
Log in or sign up to continue