/** * генерация отчета * * @param $type * @param $params */ public static function generate($params) { if (empty($params['type']) || !in_array($params['type'], array_keys(Model_Report::$reportTypes)) || empty($params['contract_id'])) { return false; } $config = Kohana::$config->load('jasper'); $client = new Client($config['host'], $config['login'], $config['password']); $controls = self::_prepareControls($params); $format = empty($params['format']) ? 'xls' : $params['format']; $type = self::$reportTypes[$params['type']]; if ($params['type'] == self::REPORT_TYPE_BILL) { $user = Auth_Oracle::instance()->get_user(); $type = str_replace('ru/aN', 'ru/a' . $user['AGENT_ID'], $type); } $report = $client->reportService()->runReport('/reports/' . $type, $format, null, null, $controls); $name = 'report_' . $params['type'] . '_' . date('Y_m_d') . '.' . $format; $headers = self::$formatHeaders[$format]; foreach ($headers as &$header) { $header = str_replace('__NAME__', $name, $header); } return ['report' => $report, 'headers' => $headers]; }
public function obtenerReportes($datos, $login) { // $cliente = new Client("http://192.168.50.80:8080/jasperserver", //maquina local de erika $cliente = new Client("http://192.168.30.218:8080/jasperserver", "jasperadmin", "jasperadmin", ""); $controls = $this->obtenerParametros($datos, $login); $report = $cliente->reportService()->runReport($this->obtenerRuta($datos->get("reporte")), $datos->get('tipo'), null, null, $controls); return $report; }
public function GeneraReporte() { ini_set('max_execution_time', 900000); $c = new Client("http://162.243.142.165:8080/jasperserver", "jasperadmin", "jasperadmin"); $c->setRequestTimeout(900000); $controls = array('stateId' => $_POST['estados']); $reporte = $c->reportService()->runReport('/reports/Blank_A4', 'html', null, null, $controls); $estados = State::orderBy('name', 'ASC')->lists('name', 'id'); $user_id = Auth::user()->id; $breadcrumbs = Neighbors::select('neighbors.name as name_ne', 'neighbors.last_name', 'urbanisms.name as name_ur ')->join('neighbors_properties', 'neighbors.id', '=', 'neighbors_properties.neighbors_id')->join('urbanisms', 'neighbors_properties.urbanism_id', '=', 'urbanisms.id')->where('neighbors.user_id', '=', $user_id)->first(); $breadcrumbs_data = $breadcrumbs->name_ne . " " . $breadcrumbs->last_name . " [" . $breadcrumbs->name_ur . "]"; return View::make("dashboard.reports.report", ['reporte' => $reporte, 'breadcrumbs_data' => $breadcrumbs_data]); }
public function __construct(Client &$client) { $this->service = $client->getService(); $this->service_url = $client->getURL(); }
<?php require_once __DIR__ . "/vendor/autoload.php"; use Jaspersoft\Client\Client; $c = new Client("http://localhost:8080/jasperserver-pro", "jasperadmin", "jasperadmin"); //------------This returns value in html form----------------- //$report = $c->reportService()->runReport("/public/Samples/Reports/01._Geographic_Results_by_Segment_Report","html"); //$report = $c->reportService()->runReport("/public/Samples/Dashboards/1._Supermart_Dashboard", "html"); // echo $report; // print_r($report); // echo str_ireplace("/jasperserver-pro/","http://localhost:8080/jasperserver-pro/",$report); //$js->getJobs("/reports/samples/AllAccounts"); $dashboard = $c->runDashboard('/public/Samples/Dashboards/1._Supermart_Dashboard'); //echo '<iframe src="'.$dashboard.'" width="1000" height="1000"></iframe>'; header('Location:' . $dashboard);
function __construct() { parent::__construct("http://localhost:8080/jasperserver", "jasperadmin", "jasperadmin"); }
<?php require_once __DIR__ . "/vendor/autoload.php"; use Jaspersoft\Client\Client; $client = new Client("http://localhost:8080/jasperserver", "scanoil", "scanoil", ""); $client->setRequestTimeout(60); $dl_format = 'xls'; $controls = array('REPORT_START_TIME' => $p_start, 'REPORT_END_TIME' => $p_end, 'REPORT_SUPPLIER_ID' => $supplier_id); $report = $client->reportService()->runReport('/reports/ScanOil/supplier/supplier_total_final', $dl_format, null, null, $controls); unset($controls);
<?php require_once __DIR__ . "/vendor/autoload.php"; use Jaspersoft\Client\Client; $c = new Client("http://localhost:8080/jasperserver", "jasperadmin", "jasperadmin", "organization_1"); $report = $c->reportService()->runReport('/reports/samples/AllAccounts', 'html'); echo $report;