Biblioteca PHPJasper
29/11/2015
0
https://github.com/geekcom/phpjasper
Daniel Lima
Post mais votado
03/01/2017
https://github.com/geekcom/phpjasper
PHPJasper
Marcus Reis.
Mais Posts
01/12/2015
Daniel Lima
https://github.com/geekcom/phpjasper
01/12/2015
Daniel Lima
01/12/2015
Rafaela Sousa
23/01/2017
Daniel Lima
https://github.com/geekcom/phpjasper/blob/master/docs/pt_BR/LEIA-ME_pt_BR.md
14/11/2019
Danillo Paiva
Criei uma vps e fiz toda a configuração, mais ao carregar o relatório no browser não carrega.
Se eu executar em modo output e pegar o código e executar no ./jasperstarter o relatório gera com sucesso, mais pelo browser não.
Segue o meu arquivo.php abaixo:
```
<?php
require __DIR__ . ''/vendor/autoload.php'';
use PHPJasper\\\\PHPJasper;
$input = __DIR__ . ''/vendor/geekcom/phpjasper/examples/venda.jrxml'';
$output = __DIR__ . ''/vendor/geekcom/phpjasper/examples'';
$options = [
''format'' => [''pdf''],
''locale'' => ''pt_BR'',
''params'' => [
''parametroprincipal'' => 5,
],
''db_connection'' => [
''driver'' => ''postgres'',
''username'' => ''*****'',
''password'' => ''*******'',
''host'' => ''*********************************'',
''database'' => ''******'',
''port'' => ''5432''
]
];
$jasper = new PHPJasper;
$jasper->process(
$input,
$output,
$options
)->execute();
// AQUI VOCÊ COLOCA O CÓDIGO PARA EXIBIR NO BROWSER.
$file = __DIR__ . ''/vendor/geekcom/phpjasper/examples/venda.pdf'';
$filename = ''venda.pdf''; /* Note: Always use .pdf at the end. */
header(''Content-type: application/pdf'');
header(''Content-Disposition: inline; filename="'' . $filename . ''"'');
header(''Content-Transfer-Encoding: binary'');
header(''Content-Length: '' . filesize($file));
header(''Accept-Ranges: bytes'');
@readfile($file);
// EXEMPLO EM PYTHON:
// https://github.com/PyReportJasper/pyreportjasper#flask-example
?>
```
Clique aqui para fazer login e interagir na Comunidade :)