本文整理汇总了PHP中Reports::executeReport方法的典型用法代码示例。如果您正苦于以下问题:PHP Reports::executeReport方法的具体用法?PHP Reports::executeReport怎么用?PHP Reports::executeReport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reports
的用法示例。
在下文中一共展示了Reports::executeReport方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view_custom_report_print
function view_custom_report_print()
{
$this->setLayout("html");
$params = json_decode(str_replace("'", '"', array_var($_POST, 'post')), true);
$report_id = array_var($_POST, 'id');
$order_by = array_var($_POST, 'order_by');
if (!isset($order_by)) {
$order_by = '';
}
tpl_assign('order_by', $order_by);
$order_by_asc = array_var($_POST, 'order_by_asc');
if (!isset($order_by_asc)) {
$order_by_asc = true;
}
tpl_assign('order_by_asc', $order_by_asc);
$report = Reports::getReport($report_id);
$results = Reports::executeReport($report_id, $params, $order_by, $order_by_asc, 0, 50, true);
if (isset($results['columns'])) {
tpl_assign('columns', $results['columns']);
}
if (isset($results['rows'])) {
tpl_assign('rows', $results['rows']);
}
tpl_assign('db_columns', $results['db_columns']);
if (array_var($_POST, 'exportCSV')) {
$this->generateCSVReport($report, $results);
} else {
if (array_var($_POST, 'exportPDF')) {
$this->generatePDFReport($report, $results);
} else {
tpl_assign('types', self::get_report_column_types($report_id));
tpl_assign('template_name', 'view_custom_report');
tpl_assign('title', $report->getName());
tpl_assign('model', $report->getObjectType());
tpl_assign('description', $report->getDescription());
$conditions = ReportConditions::getAllReportConditions($report_id);
tpl_assign('conditions', $conditions);
tpl_assign('parameters', $params);
tpl_assign('id', $report_id);
tpl_assign('to_print', true);
$this->setTemplate('report_printer');
}
}
}
示例2: view_custom_report_print
function view_custom_report_print()
{
$this->setLayout("html");
set_time_limit(0);
$params = json_decode(str_replace("'", '"', array_var($_POST, 'post')), true);
$report_params = json_decode(str_replace("'", '"', array_var($_POST, 'report_params')), true);
$report_id = array_var($_POST, 'id');
$order_by = array_var($_POST, 'order_by');
if (!isset($order_by)) {
$order_by = '';
}
tpl_assign('order_by', $order_by);
$order_by_asc = array_var($_POST, 'order_by_asc');
if (!isset($order_by_asc)) {
$order_by_asc = true;
}
tpl_assign('order_by_asc', $order_by_asc);
$report = Reports::getReport($report_id);
$limit = array_var($_POST, 'exportCSV') || array_var($_POST, 'exportPDF') ? -1 : 50;
$results = Reports::executeReport($report_id, $report_params, $order_by, $order_by_asc, 0, $limit, true);
if (isset($results['columns'])) {
tpl_assign('columns', $results['columns']);
}
if (isset($results['rows'])) {
tpl_assign('rows', $results['rows']);
}
tpl_assign('db_columns', $results['db_columns']);
if (array_var($_POST, 'exportCSV')) {
$filename = $this->generateCSVReport($report, $results);
ajx_current("empty");
ajx_extra_data(array('filename' => $filename));
} else {
if (array_var($_POST, 'exportPDF') && !is_exec_available()) {
$this->generatePDFReport($report, $results);
} else {
tpl_assign('types', self::get_report_column_types($report_id));
tpl_assign('template_name', 'view_custom_report');
tpl_assign('title', $report->getObjectName());
$ot = ObjectTypes::findById($report->getReportObjectTypeId());
tpl_assign('model', $ot->getHandlerClass());
tpl_assign('description', $report->getDescription());
$conditions = ReportConditions::getAllReportConditions($report_id);
tpl_assign('conditions', $conditions);
tpl_assign('parameters', $params);
tpl_assign('id', $report_id);
tpl_assign('to_print', true);
if (array_var($_POST, 'exportPDF')) {
tpl_assign('pdf_export', true);
$html_filename = ROOT . '/tmp/' . gen_id() . 'pdf.html';
$pdf_filename = $report->getObjectName() . '.pdf';
tpl_assign('html_filename', $html_filename);
tpl_assign('pdf_filename', $pdf_filename);
tpl_assign('orientation', array_var($_POST, 'pdfPageLayout') == 'L' ? 'Landscape' : 'Portrait');
ob_start();
}
$this->setTemplate('report_printer');
}
}
}