You can generate a PDF report in Peliqan in different ways. In this example, we are making data visualisations first, and then we save these to a PDF report.

We are using the built-in Streamlit module (st) in Peliqan to render our data visualisations (tables, charts etc.). Next we use the Peliqan module (pq) to convert the Streamlit output on screen to a PDF document.

Click here for more information on data visualisation in Peliqan using Streamlit.

Example low-code Python script in Peliqan:

import pdfkit

dbconn = pq.dbconnect('dw_123')
data = dbconn.fetch('dw_123', 'crm', 'INVOICES')
data = data[["DISPLAY_NAME", "ACCOUNT_ID", "COMPANY_ID", "QUANTITY", "PRODUCT_ID", "PRICE_TOTAL"]]

# Use any Streamlit data visualisation here
st.table(data)
st.bar_chart(data, x = "country", y = "revenue")

pq.download_pdf_button(report, file_name = "report.pdf", label = "Download PDF")