You are here

function forena_report_include in Forena Reports 8

Same name and namespace in other branches
  1. 7.5 forena.module \forena_report_include()
  2. 7.3 forena.module \forena_report_include()
  3. 7.4 forena.module \forena_report_include()

Render report as an inlcude. Don't perform the output fuctnions for the document

Parameters

$report_name String:

$parms array of parameters to include:

Return value

string String representation of inlcuded report.

1 call to forena_report_include()
RendererBase::renderDomNode in src/FrxPlugin/Renderer/RendererBase.php
Recursive report renderer Walks the nodes rendering the report.

File

./forena.module, line 181

Code

function forena_report_include($report_name, $parms = array()) {
  $output = '';
  require_once 'forena.common.inc';
  $desc = FrxAPI::Menu()
    ->parseURL($report_name);
  $name = $desc['name'];
  $r = @FrxReportGenerator::instance()
    ->get_report($name, $parms);
  if (!$r || !$r->rpt_xml) {
    return '';
  }

  //check for default parameters
  $r
    ->processParameters();
  $format = $desc['format'];
  $r
    ->render($format, FALSE);
  $o = FrxAPI::Document($format);
  if ($o) {
    $output = $o
      ->render($r, $format, array());
  }
  return $output;
}