Skip to contents

tfl_report() is the document half of a report definition: the page, the running header and footer, the titles and footnotes, and the table's pages — an rtfreporter::table_plan() or anything rtfreporter::rtf_tables() takes — in one rtfreporter::rtf_document() ready for rtfreporter::generate_rtfreport(). The document carries its program, so {PROGRAM} needs nothing more, and its file (tfl_report_path(): rtf_document(file = )), so generate_rtfreport(doc) writes there; a path given to it wins. A YAML report's file needs its study.

Usage

tfl_report(spec, output_id = NULL, content, study = NULL)

Arguments

spec

A report definition (tfl_read_report_spec()) narrowed to one report, or the path(s) to read it from; or a report of the YAML spec (tfl_output(), resolved: tfl_resolve_output()), its page: the calls – rtf_page, rtf_default_format, rtf_document, rtf_tables / rtf_figures, rtf_titles, rtf_footnotes, each its arguments, and the lines of header, footer, titles, footnotes and the tokens.

output_id

The report, when spec is a path or still defines several.

content

The report's content: an rtfreporter::table_plan() or rtftable pages for a table or listing, figures for a type = figure report.

study

For a YAML report: the study (tfl_read_study_spec()), for its program (the TOC's program, else settings: program, in settings: program_dir), and where the report's titles and footnotes print: settings: titles_at header (the running header, after the study's lines) or titles (above the table), footnotes_at footer (the running footer, before the study's lines) or footnotes (below the table); not set, above and below the table.

Details

spec <- tfl_read_report_spec(c("report.xlsx", "tables.xlsx"), output_id = id)
plan <- ard |> normalize_ard() |> tfl_table_plan(spec)
generate_rtfreport(tfl_report(spec, content = plan))   # to tfl_report_path(spec)

The table engine

The ARD functions and the plan are rtfreporter's: help("ard-tables", package = "rtfreporter").