XSQUARE – REPORTS
XSQUARE — REPORTS is a web service for reports in various formats. XSQUARE — REPORTS receives HTTP requests in XML or JSON and uses template documents to generate reports.
-
In the management console, select the folder where you want to deploy the application.
-
Create a cloud network and a subnet to host the virtual machine (VM).
-
Get an SSH key pair for connection to the VM.
-
Go to Cloud Apps.
-
In the left-hand panel, select Marketplace.
-
Select XSQUARE — REPORTS and click Use.
-
On the page that opens:
- Specify the application name and (optionally) description.
- Select a service account from the list or click Automatically to create a service account with all required permissions automatically during the installation of the app. This service account will be used to create the application resources. It needs at least the following roles:
resource-manager.admincompute.editoriam.editorvpc.publicAdmin
- Select the cloud network and subnet you created earlier.
- Enter a VM user login.
- Specify the user’s public SSH key for connection to the VM.
- Specify the size of the user disk for templates in the range from 10 to 100 GB.
-
Click Install and wait for the installation to complete.
-
Connect to the VM over SSH:
```bash ssh <VM_user_login>@<VM_public_IP_address> ``` -
To use you own templates:
-
Create a directory for templates on the
/datadisk, e.g.,/data/mytemplates/templates/:sudo mkdir -p /data/mytemplates/templates/ -
Copy your templates to the new directory. The templates must reside in the
templates/subdirectory.sudo cp -r /path/to/your/templates/* /data/mytemplates/templates/ -
Edit the XSQUARE — REPORTS configuration file,
/usr/local/xsquare.xreports/config.json. In the"app"object, add or update the"data-directory"property by specifying the template directory path without the/templatessuffix. For more information, see this guide. -
Restart the service for the changes to take effect:
sudo systemctl restart xsquare.xreports
-
Calling the service to generate a DOCX document:
curl -X POST \
'http://<floating_ip_address>:8886/word_report_json' \
-H 'Content-Type: application/json' \
-d '{
"template":
{
"uri": "local",
"id": "examples/docx/first_report_template"
},
"input-data":
{
"ORGANIZATION": "Example LLC",
"DATE": "01.01.2023",
"EMP": "John Richard Doe"
},
"options":
{
"output-mode": "binary"
}
}' \
--output "my_first_report.docx"
For more report generation test use cases, see the xsquare.xreports/templates/examples/ directory on the VM.
XSQUARE
To get support, contact support@xsquare.ru or your XSQUARE Profile support module.
Yandex Cloud
Yandex Cloud does not provide support for this product. If you have any issues, please refer to the vendor’s information resources.
| Resource type | Quantity |
|---|---|
| Service account | 1 |
| Disk | 1 |
| Virtual machine | 1 |
| Access rights for folder | 1 |