(require '[boundary.reports.core.report :as r]
'[boundary.reports.shell.service :as reports])
(r/defreport invoice-report
{:id :invoice-report
:type :pdf
:page-size :a4
:filename "invoice.pdf"
:template (fn [data]
[:html
[:head [:title "Invoice"]]
[:body
[:h1 "Invoice #" (:invoice-number data)]
[:table
[:thead [:tr [:th "Item"] [:th "Amount"]]]
[:tbody
(for [line (:lines data)]
[:tr [:td (:description line)]
[:td (str "€ " (:amount line))]])]]]])})
(def output (reports/generate invoice-report {:invoice-number 42 :lines [...]}))
;=> {:bytes #bytes[...] :type :pdf :filename "invoice.pdf"}