---
title: "Example 1: Listing"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Example 1: Listing}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r setup, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```

### Create a Simple Listing

Here is an example of 
a regulatory-style listing using **reporter** and the iris sample data frame.
Notice how the `write_report()` function breaks the page automatically
and appropriately:

```{r eval=FALSE, echo=TRUE} 
library(reporter)

# Create temp file name
tmp <- file.path(tempdir(), "example1.pdf")

# Create the report
rpt <- create_report(tmp, orientation = "portrait", output_type = "PDF") %>% 
  page_header(left = "Client: 1-800-Flowers", right = "Study: Iris") %>% 
  titles("Listing 1.0", "IRIS Data Listing") %>% 
  add_content(create_table(iris)) %>% 
  footnotes("* Bulletin of the American Iris Society, 1935") %>%
  page_footer(left = Sys.time(), 
              center = "Confidential", 
              right = "Page [pg] of [tpg]")

# Write the report
write_report(rpt)

# file.show(tmp)

```
<img src="../man/images/e1a.png" alt="Listing example page 1"/>
<img src="../man/images/e1b.png" alt="Listing example page 2"/>
<img src="../man/images/e1c.png" alt="Listing example page 3"/>

Next: [Example 2: Table](reporter-table.html)
