public function FrxDocument::render in Forena Reports 7.3
Same name and namespace in other branches
- 7.4 FrxDocument.inc \FrxDocument::render()
10 methods override FrxDocument::render()
- FrxCSVDoc::render in docformats/
FrxCSVDoc.inc - FrxEmailMergeDoc::render in docformats/
FrxEmailMergeDoc.inc - FrxHtmlDoc::render in docformats/
FrxHtmlDoc.inc - FrxMPDF::render in docformats/
FrxMPDF.inc - FrxPrincePDF::render in docformats/
FrxPrincePDF.inc
File
- ./
FrxDocument.inc, line 31 - FrxDocument.inc Given a report, render the appropriate output given the document format. @author davidmetzler
Class
- FrxDocument
- @file FrxDocument.inc Given a report, render the appropriate output given the document format. @author davidmetzler
Code
public function render($r, $format, $options = array()) {
$header = '<h1>' . $r->title . '</h1>';
$output = $header . $output;
$css_text = '';
$r_text = '';
$stylesheets = Frx::Skin()->stylesheets;
foreach ($stylesheets as $type => $sheets) {
foreach ($sheets as $sheet) {
switch ($type) {
case 'all':
case $this->format:
$css_file[] = $sheet;
break;
}
}
}
if ($css_files) {
foreach ($css_files as $css_file) {
$css_text .= file_get_contents($css_file);
}
}
$options = array(
'css' => $css_text,
'docname' => str_replace(' ', '_', $title),
'xml' => $r_text,
'title' => $title,
);
$output = $this
->generate_doc($format, $output, $options, $print);
if ($format != 'email') {
print $output;
}
}