當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Reports::executeReport方法代碼示例

本文整理匯總了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');
         }
     }
 }
開發者ID:pnagaraju25,項目名稱:fengoffice,代碼行數:44,代碼來源:ReportingController.class.php

示例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');
         }
     }
 }
開發者ID:abhinay100,項目名稱:feng_app,代碼行數:59,代碼來源:ReportingController.class.php


注:本文中的Reports::executeReport方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。