HTMLReportRef-class {ReportingTools} | R Documentation

## Class `"HTMLReportRef"`

### Description

A referenceClass-based representation of an HTML report generated using R objects. This class is based around a persistent, DOM-based representation of the HTML page being created, which is created during initialization and updated as the report is manipulated. `HTMLReport` is the constructor function for the class.

### Details

Publication behavior of `HTMLReportRef` reports is controlled via an event-observer paradigm. Developers specify behavior in the form of one or more `ReportHandlers` objects. These objects contain instructions (in the form of R functions) to be carried out whenever certain actions are taken. These actions are: initial report creation ("init"), elements being added to the report ("addElement"), elements being removed from the report ("removeElement"), and the report being finalized ("finish"). See `ReportHandlers` for more detail.

### Methods

[[<-

  `signature(x = "HTMLReportRef", i = "ANY", j = "ANY", value = "ANY")`: Place an element representing `value` into the report. This will replace any existing element by the same name in the report. `x$addElement` is used to perform the actual report manipulation.

[[

  `signature(x = "HTMLReportRef", i = "ANY")`: Access an element within the report. The element will be returned in its DOM/HTML representation.

publish

  `signature(object = "ANY", publicationType = "HTMLReportRef")`: Place an element representing `object` into the report. `publicationType$addElement` is used to perform the actual report manipulation.

path

  `signature(object = "HTMLReportRef")`: The paths returned by each of the `ReportHandlers` for the report.

### Fields

`shortName`:

  Short version of report name.

`title`:

  Title of the report.

`reportDirectory`:

  Directory (relative to `basePath`) in which to publish the report.

`basePath`:

  Base path to publish to.

`handlers`:

  A list of `ReportHandlers` objects specifying actions to be taken in reponse specific events during the report creation/manipulation process. See Details.

### Class-Based Methods

`prepare(obj, ...)`:

  Prepare an R object to be added to the report by converting it to an HTML representation. Currently this is done by calling the `objectToHTML` function on the object, though this is likely to change in the future.

`initialize(...)`:

  Initialize the report, including generating the base HTML structure. The `init` function for each `ReportHandlers` object in `handlers` is called at the end of this process.

`addElement(name, value, ...)`:

  Add an element to the report. `prepare` is called to generate an HTML representation for `value`. That representation is then added to the internal DOM representation of the report. The `addElement` function for each `ReportHandlers` object in `handlers` is called at the end of this process.

`finish()`:

  Finalize a report. This causes the `finish` function on each element of `handlers` to be called. This is something of a misnomer in that the report can be further manipulated and "finished" again after this function has been called.

### Author(s)

Gabriel Becker <gmbecker@ucdavis.edu>

### See Also

`ReportHandlers`

### Examples

    showClass("HTMLReportRef")

[Package ReportingTools version 2.24.0 Index]