[net.tbt-post/clj-jasper "0.0.10"]
A Clojure library to work with Jasper Reports
Add the following to your Leiningen’s project.clj
:
[net.tbt-post/clj-jasper "0.0.10"]
(ns my-app.jasper
(:require [clj-jasper.core :as jc]
[clojure.java.io :as io]))
(defn render [name data properties]
(binding [jc/*jr-templates-path* "my-templates"]
(let [out (jc/data->report {:name (format "my-reports/%s" name)
:data data
:ops properties})]
{:status 200
:headers {"Content-Type" (:type out)
"Content-Disposition" (format "attachment; filename=\"%s\"" (:name out))
"Cache-Control" "no-cache"}
:body (-> out :file io/input-stream)})))
Current implementation supports only PDF generations.
There is a bug in JAXP/XERCES (derived from CLJ←JR←Digester) that prevent the use of a parser that contains a schema with a DTD.
Well tested with Java versions:
OpenJDK 11.0.12
OpenJDK 15.0.1
GraalVM 19.3.6.r11
Corretto 8.322.06.1
Version v0.0.9 may be runtime incompatible with uberjar build in some circumstances
Copyright © 2018-2022
Distributed under the MIT License.
Can you improve this documentation? These fine people already did:
MelKori, source-c & Oleg NogaEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close