Skip to content

Uncaught PHPJasper #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wiltonbarros opened this issue Jul 13, 2019 · 3 comments
Closed

Uncaught PHPJasper #154

wiltonbarros opened this issue Jul 13, 2019 · 3 comments

Comments

@wiltonbarros
Copy link

wiltonbarros commented Jul 13, 2019

Boa tarde!
Estou tentando iniciar os testes com o phpjasper, fiz as configurações conforme tutorial inicial, também acompanhei os passos da issue #15.
Atualmente tenho o java 1.8 instalado com java_home configurado e também o path.
Abaixo segue código que utilizei para efetuar os testes iniciais:

use PHPJasper\PHPJasper;

$input = '../composer/vendor/geekcom/phpjasper/examples/hello_world.jrxml';
$jasper = new PHPJasper;
$jasper->compile($input)->execute();

$input = '../composer/vendor/geekcom/phpjasper/examples/hello_world.jasper';

$output ='../composer/vendor/geekcom/phpjasper/examples';
$options = [
'format' => ['pdf', 'rtf']
];

$jasper = new PHPJasper;

$jasper->process(
$input,
$output,
$options
)->execute();

O erro gerado é: "Fatal error: Uncaught PHPJasper\Exception\ErrorCommandExecutable: Your report has an error and couldn 't be processed!\ Try to output the command using the function output(); and run it manually in the console. in C:\xampp2\htdocs\php\sistema_ativos\composer\vendor\geekcom\phpjasper\src\PHPJasper.php:219 Stack trace: #0 C:\xampp2\htdocs\php\sistema_ativos\public\patrimonio.php(65): PHPJasper\PHPJasper->execute() #1 {main} thrown in C:\xampp2\htdocs\php\sistema_ativos\composer\vendor\geekcom\phpjasper\src\PHPJasper.php on line 219".

O arquivo .jasper está sendo gerado no diretório em questão.

Obrigado!

@geekcom
Copy link
Member

geekcom commented Jul 14, 2019

@wiltonbarros Execute o método output() e vai ficar fácil achar onde está o erro, confira sua conexão, pode estar aí o erro.

@wiltonbarros
Copy link
Author

@geekcom Obrigado pelo rápido retorno!
Ontem após abertura da issue, fiz uma verificação no path do relatório, inclui o path completo, "c:\xamp...", e então funcionou.
Neste momento estou trabalhando com os parâmetros dentro do jasper para o php.
Pode encerrar esta issue.
Obrigado mais uma vez!

@code-chip
Copy link

I have the same problem, follow the information:
Distro Linux Mint 19.3 Tricia

image
Erro:
Fatal error: Uncaught PHPJasper\Exception\ErrorCommandExecutable: Your report has an error and couldn 't be processed!\ Try to output the command using the function output(); and run it manually in the console. in /home/will/Documentos/projetos/examples/vendor/geekcom/phpjasper/src/PHPJasper.php:250 Stack trace: #0 /home/will/Documentos/projetos/examples/test.php(25): PHPJasper\PHPJasper->execute() #1 {main} thrown in /home/will/Documentos/projetos/examples/vendor/geekcom/phpjasper/src/PHPJasper.php on line 250

When exchanging execution for output, no error is displayed.
When printing the output, the result is as follows:

./jasperstarter process "/var/www/html/examples/vendor/geekcom/phpjasper/examples/hello_world.jasper" -o "/var/www/html/examples/vendor/geekcom/phpjasper/examples" -f pdf rtf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants