You are here

public function FrxReport::render in Forena Reports 7.3

Same name and namespace in other branches
  1. 6.2 FrxReport.inc \FrxReport::render()
  2. 6 FrxReport.inc \FrxReport::render()
  3. 7 FrxReport.inc \FrxReport::render()
  4. 7.2 FrxReport.inc \FrxReport::render()
  5. 7.4 FrxReport.inc \FrxReport::render()

Render the report

Return value

unknown_type

File

./FrxReport.inc, line 355
Basic report provider. Controls the rendering of the report.

Class

FrxReport

Code

public function render($format, $render_form = TRUE) {
  if (!$format) {
    $format = 'web';
  }

  // Only push the parameter conte
  Frx::Data()
    ->push($this->parms, 'parm');
  $this->format = $format;
  $dom = $this->dom;
  $o = '';
  $body = $dom
    ->getElementsByTagName('body')
    ->item(0);
  if (!$this->missing_parms || $this->rpt_xml
    ->xpath('//*[@frx:renderer="FrxParameterForm"]')) {
    foreach ($body->childNodes as $node) {
      $o .= $this
        ->render_section($node);
    }
  }

  // Default in dynamic title from head.
  if ($this->frx_title) {
    $title = check_plain($this->teng
      ->replace($this->frx_title));
    if ($title) {
      $title = $this->title = $title;
    }
  }
  if ($render_form && !$this->rpt_xml
    ->xpath('//*[@frx:renderer="FrxParameterForm"]') && $format == 'web') {
    $variables = array(
      'collapsed' => $this->blocks_loaded,
    );
    $form = $this
      ->parametersForm($variables);
    $o = drupal_render($form) . $o;
  }
  $this->html = $o;
  Frx::Data()
    ->pop();
  return $o;
}