rapport v0.6.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
Generates HTML for the report
See Rapport.Page.generate_page/2
See Rapport.Page.generate_page/5
See Rapport.Page.generate_pages/2
See Rapport.Page.generate_pages/3
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
See Rapport.Page.wrap_page_with_padding/2
See Rapport.Page.wrap_page_with_padding/5
Link to this section Functions
Generates HTML for the report.
Options
report
- TheRapport.Report
that you want to generate to HTML.
See Rapport.Page.generate_page/2
.
See Rapport.Page.generate_page/5
.
See Rapport.Page.generate_pages/2
.
See Rapport.Page.generate_pages/3
.
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
See Rapport.Page.wrap_page_with_padding/2
.
See Rapport.Page.wrap_page_with_padding/5
.