当前位置: 首页>>代码示例>>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;未经允许,请勿转载。