rapport v0.5.0 Rapport
Rapport aims to provide a robust set of modules to generate HTML reports that both looks good in the browser and when being printed.
Link to this section Summary
Functions
Adds a new page to a report
Adds a new page to a report
Adds a list of pages to a report
Generates HTML for the report
Creates a new report
Sets the padding (in millimeters) for the report
Sets the paper size for the report
Sets the rotation for the report
Sets the title for a report. This is the title of the generated html report
Link to this section Functions
Adds a new page to a report.
Options
report
- ARapport.Report
struct that you want to add the page to.page
- ARapport.Page
struct
Adds a new page to a report.
Options
report
- ARapport.Report
struct that you want to add the page to.page_template
- An EEx template for the pagefields
- A map with fields that must be assigned to the EEx template
Adds a list of pages to a report.
Options
report
- ARapport.Report
struct that you want to add the page to.pages
- A list withRapport.Page
structs
Generates HTML for the report.
Options
report
- TheRapport.Report
that you want to generate to HTML.
Creates a new report.
An optional EEx template can be passed to the new
function. This template
is meant to hold global things like styles, fonts etc that can be used on all
pages thats added to the report.
The new
function sets the default paper size to :A4
, the rotation
to :portrait
, the page padding to 10mm and the report title to “Report”.
Those defaults can easily be overridden by using set_paper_size/2
,
set_rotation/2
, set_padding/2
and set_title/2
.
Returns a Rapport.Report
struct.
Options
template
- An optional EEx template for the report.fields
- A map with fields to assign to the EEx report template
Sets the padding (in millimeters) for the report.
It expects the padding to be an integer and must be 10
, 15
, 20
or 25
mm,
otherwise ArgumentError
will be raised.
Options
report
- TheRapport.Report
that you want set the padding forrotation
- The padding.
Sets the paper size for the report.
It expects the paper size to be an atom and must be
:A4
, :A3
, :A5
, :half_letter
, :letter
, :legal
, :junior_legal
or :ledger
, otherwise ArgumentError
will be raised.
Options
report
- TheRapport.Report
that you want set the paper size forpaper_size
- The paper size.
Sets the rotation for the report.
It expects the rotation to an atom and must be :portrait
or :landscape
,
otherwise ArgumentError
will be raised.
Options
report
- TheRapport.Report
that you want set the rotation forrotation
- The rotation.
Sets the title for a report. This is the title of the generated html report.
Options
report
- TheRapport.Report
you want to set the title for.title
- The new title