joshuaclayton/elm-report-builder/1.0.0

ReportBuilder

A report builder is a data structure that allows you to build a report with a list of records and a list of fields. You can add fields to the report and then generate a CSV representation of the report.

Definition

A report builder is a data structure that allows you to build a report with a list of records and a list of fields. You can add fields to the report and then generate a CSV representation of the report.

Constructor

new : { records : List a } -> ReportBuilder a

Create a new report builder with a list of records.

Modification

Add a field to the report builder.

Set the name of the report builder.

This is used for generating the filename when downloading the CSV.

Output

toCsv : ReportBuilder a -> String

Convert a report builder to a CSV string.

Commands

downloadCsv : ReportBuilder a -> Cmd msg

Generate a command to download the CSV representation of the report builder.