You are here

FrxWordDoc.inc in Forena Reports 7.3

Same filename and directory in other branches
  1. 7.4 docformats/FrxWordDoc.inc

FrxWordDoc.inc Word document exporter. @author davidmetzler

File

docformats/FrxWordDoc.inc
View source
<?php

/**
 * @file FrxWordDoc.inc
 * Word document exporter.
 * @author davidmetzler
 *
 */
class FrxWordDoc extends FrxDocument {
  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">' . $this
      ->check_markup($r->html) . '</body></html>';
    return $output;
  }
  public function output($output) {
    parent::output($this
      ->convertCharset($output, 'windows-1252'));
    return TRUE;
  }

}

Classes

Namesort descending Description
FrxWordDoc @file FrxWordDoc.inc Word document exporter. @author davidmetzler