Biblioteca PHPJasper
Olá pessoal eu e mais dois amigos criamos uma biblioteca para gerar relatórios em PHP, forks são bem vindos.
https://github.com/geekcom/phpjasper
https://github.com/geekcom/phpjasper
Daniel Lima
Curtidas 1
Melhor post
Marcus Reis.
03/01/2017
A biblioteca em questão foi atualizada e está muito estável.
https://github.com/geekcom/phpjasper
PHPJasper
https://github.com/geekcom/phpjasper
PHPJasper
GOSTEI 1
Mais Respostas
Marcio Araujo
29/11/2015
Legal mesmo, parabens!
GOSTEI 0
Rafaela Sousa
29/11/2015
Tem manual?
GOSTEI 0
Daniel Lima
29/11/2015
Sim Rafaela, basta ler o README.md, tem tudo que você precisa lá, qualquer dúvida pergunte.
https://github.com/geekcom/phpjasper
https://github.com/geekcom/phpjasper
GOSTEI 0
Rafaela Sousa
29/11/2015
README.md? O manual está em inglês mesmo?
GOSTEI 0
Daniel Lima
29/11/2015
Sim a documentação está em inglês, achamos melhor para contribuir com a comunidade mundial, em breve escreverei um artigo ensinando passo a passo como usar, aqui mesmo na DevMedia.
GOSTEI 0
Rafaela Sousa
29/11/2015
Um artigo na Devmedia seu? Se lembrar pode publicar aqui nesse post?
GOSTEI 0
Daniel Lima
29/11/2015
Ainda não existe, estou produzindo.
GOSTEI 0
Rafaela Sousa
29/11/2015
Quando terminar divulga aqui por favor.
GOSTEI 0
Daniel Lima
29/11/2015
Pode deixar que divulgo.
GOSTEI 0
Rafaela Sousa
29/11/2015
Obrigada.
GOSTEI 0
Daniel Lima
29/11/2015
A biblioteca PHPJasper finalmente está com a documentação em português.
https://github.com/geekcom/phpjasper/blob/master/docs/pt_BR/LEIA-ME_pt_BR.md
https://github.com/geekcom/phpjasper/blob/master/docs/pt_BR/LEIA-ME_pt_BR.md
GOSTEI 0
Robson Cavalcante
29/11/2015
Opa, ótima colaboração :)
GOSTEI 0
Danillo Paiva
29/11/2015
Bom Dia,
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
?>
```
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
?>
```
GOSTEI 0