PoC to showcase a performant pdf report generation:
- fast performing
- 400 issues report: 2 seconds (on Mac Book Pro)
- 2600 issues report: 4 seconds (on Mac Book Pro)
- 100.000 issues report: 30 seconds (on Mac Book Pro)
- proper page breaks
- page numbers
- using a report/template engine (Jasper Reports)
It takes a CSV file in (manually downloaded from Snyk New Reporting UI), and generates a PDF file based on it.
You can find a sample PDF reports under
mvn install
The build creates a fat jar with all dependencies included.
java -jar snyk-csv-to-pdf-x.y-jar-with-dependencies.jar </path/to/csv/file.csv>
Example:
mvn install
java -jar target/snyk-csv-to-pdf-1.0-jar-with-dependencies.jar samples/sample.csv
mvn install
docker build -t snyk-csv-to-pdf .
docker run -v $(PWD)/samples:/data/ snyk-csv-to-pdf /data/sample.csv
If you don't want to build the project yourself but just quickly want to convert an existing csv file, use the pre-built image:
docker run -v $(PWD)/samples:/data/ mathiasconradt/snyk-csv-to-pdf /data/sample.csv
If you want to adjust the report template (snyk.jrxml), you can download the Jaspersoft Studio Community Edition from https://community.jaspersoft.com/project/jaspersoft-studio/releases
Open the /design/snyk.jrxml
and for testing with sample data, adjust the path to the CSV file in the data adapter (/design/DataAdapter.jrdax
) to point to the right path on your local machine.
You can use /samples/sample.csv
as a sample CSV file.
When done editing the template, make sure to compile it to snyk.jasper
(right-click on snyk.jrxml
> JasperReports > Compile Report).
- Mathias Conradt (@mathiasconradt)
- Sebastian Roth (@ened)