Generate Reports
In this section we’ll cover how to generate reports from the data we collect in our database using the clj-pdf library.[110] Then we’ll discuss how to serve the generated PDF to the browser using the appropriate response type.
Our application will have an employee table that will be populated with some sample data. We’ll use this data to create a couple of different PDF reports, and we’ll allow the users to select the type of report they wish to view. Let’s create a new application called reporting-example using the Luminus template.
| $ lein new luminus reporting-example +postgres |
Now we open the project.clj file to add the clj-pdf dependency.
| :dependencies [... |
| [clj-pdf "2.5.5"]] |
We also have to ...
Get Web Development with Clojure, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.