You are here

function forena_report_include in Forena Reports 7.3

Same name and namespace in other branches
  1. 8 forena.module \forena_report_include()
  2. 7.5 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:

2 calls to forena_report_include()
FrxBean::view in bean/FrxBean.inc
Return the block content.
FrxInclude::render in renderers/FrxInclude.inc

File

./forena.module, line 835

Code

function forena_report_include($report_name, $parms = array()) {
  $output = '';
  require_once 'forena.common.inc';
  $desc = Frx::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 = Frx::Document($format);
  if ($o) {
    $output = $o
      ->render($r, $format, array());
  }
  return $output;
}