You are here

class WordDocument in Forena Reports 7.5

Hierarchy

Expanded class hierarchy of WordDocument

File

src/DocumentFormats/WordDocument.php, line 10
WordDocument.inc Word document exporter. @author davidmetzler

Namespace

Drupal\forena\DocumentFormats
View source
class WordDocument extends DocumentTypeBase {
  public function __construct() {
    $this->content_type = 'application/msword';
  }
  public function render($r, $format, $options = array()) {
    $css = $this
      ->loadCSSFiles($format);
    $output = '<html><head>';
    $output .= '<meta http-equiv="Content-Type" content="text/html"/>';
    if (isset($r->rpt_xml->head->style)) {
      $output .= '<style type="text/css">';
      $output .= $css;
      if (isset($r->rpt_xml->head->style)) {
        $sheet = (string) $r->rpt_xml->head->style;
        $output .= $sheet;
      }
      $output .= '</style>';
    }
    $output .= '<title>' . $r->title . '</title></head><body class="forena-report">' . $r->html . '</body></html>';
    return $output;
  }
  public function output(&$output) {
    $output = $this
      ->convertCharset($output, 'windows-1252');
    parent::output($output);
    return TRUE;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DocumentTypeBase::$allowDirectOutput public property
DocumentTypeBase::$charset public property
DocumentTypeBase::$content_type public property
DocumentTypeBase::$format public property
DocumentTypeBase::$print public property
DocumentTypeBase::check_markup public function Wrapper function for check output to default the right type.
DocumentTypeBase::convertCharset public function
DocumentTypeBase::header public function 5
DocumentTypeBase::loadCSSFiles public function
WordDocument::output public function Overrides DocumentTypeBase::output
WordDocument::render public function Overrides DocumentTypeBase::render
WordDocument::__construct public function