Fixes #25099 - Add macros for easier report definition
Add rows to a report with <%- report_row( 'Column header 1': 'Value 1', 'Column header 2': `Value 2`, ) -> and render the report with <= report_render -%>
Each row of the report needs to have the same columns. report_render produces properly quoted valid CSV. Values are converted to a String using to_s. Enumerable values are comma separated and serialized.
Experimental render to YAML is included (report_render(format: :yaml) Enumerable values are kept structured in this format.
Related issues
Feature #25099: Report templates need macros for easy report definition
Fixes #25099 - Add macros for easier report definition
Add rows to a report with
<%- report_row(
'Column header 1': 'Value 1',
'Column header 2': `Value 2`,
) ->
and render the report with
<= report_render -%>
Each row of the report needs to have the same columns.
report_render produces properly quoted valid CSV.
Values are converted to a String using to_s.
Enumerable values are comma separated and serialized.
Experimental render to YAML is included (report_render(format: :yaml)
Enumerable values are kept structured in this format.