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
Support to Collections #64
Comments
Hi @flavio-jr, Parameters can be used in SQL queries to filter records in a where condition or to add/replace pieces of raw SQL or even to pass the entire SQL string to execute.
In this example my_order_id is a parameter that contains the ID of the order to read. This parameter can be passed to the report from the application that is running it to select only a specific order. Please note that the parameter here is a real SQL parameter, meaning that the query will be executed using a prepared statement like:
Please read this article: |
I want to use a WHERE IN statement in my SQL, so i'm passing many ids to my report. In iReport they use a Collection parameter to filter the registers. I just want to know if is possible to pass such parameter type from PHP to Jasper |
Here is my workaround: I'm passing a string parameter, and in the report I make a "split" to get an array. |
@flavio-jr you can provide me a sample of your report ? |
PE8b.zip |
@flavio-jr Do you have a working example? Can't get to work with collections. |
When I put a parameters we have a Fatal error: Uncaught PHPJasper\Exception\ErrorCommandExecutable: your report has an error couldn´t be processed. I did in JasperSoft Studio: Select * from table Where field between P{field_start} and P{field_end} In PHPJasper: $file = 'DataMatrix.jasper'; $input = DIR.DIRECTORY_SEPARATOR.$file; Without parameters result a blank report, With partameters result the error. I couldn´t find out the error. I thank for help, and sorry for my bad english. |
Hi @hemimm please check your .jrxml report,
|
As my english is not good, I will add information in portuguese. Para ver as informações passadas, coloque $jasper->process($input,$output,$options)->output e obtive Espero que com isto ajude a solucionar o problema. |
Yes, it is in this way. |
In JasperSoft Studio, the report is normal, but not in PHPJasper |
the complete error: Fatal error: Uncaught PHPJasper\Exception\ErrorCommandExecutable: Your report has an error and couldn 't be processed!\ Try to output the command using the function |
line 157 is $jasper($input,$output,$options)->execute() |
Yes, it is in this way. In deed in JasperSoft Studio the report is normal, but not in PHPJasper
Enviado do Email<https://go.microsoft.com/fwlink/?LinkId=550986> para Windows 10
…________________________________
De: Daniel Rodrigues <notifications@github.com>
Enviado: Thursday, May 3, 2018 9:37:49 AM
Para: PHPJasper/phpjasper
Cc: hemimm; Mention
Assunto: Re: [PHPJasper/phpjasper] Support to Collections (#64)
Hi @hemimm<https://github.com/hemimm> please check your .jrxml report,
parameters should be used in this way:
$P{my_order_id}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#64 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AeEASsU0NrC_Pb4-nVidd5sMHnwI4lJJks5tuvodgaJpZM4PjUsa>.
|
Daniel bom dia! (Daniel good morning!)
Como disse ele já está desta forma.
Não sei se isto ajuda, mas o .jrxml tem 2 código de barras e 1 datamatrix do Barcode e 3 imagens, todos do Basic Elements do JasperSoft Studio. Podem estar interferindo, se estiverem não sei como interagir com o PHPJasper.
O Relatório está em formato de etiquetas, com 4 etiquetas / página.
As I told you before my .jrxml is aready in this way $P{parameter}
I do not know if this help you, but my .jrxml has 2 bar code and 1 datamatrix from Barcode and 3 images, all from Basic Elements´s JasperSoft Studio. They could be interfering, if they were I do not know how to Interact with PHPJasper.
My Report is in label format, with 4 label / page.
At.
Enviado do Email<https://go.microsoft.com/fwlink/?LinkId=550986> para Windows 10
…________________________________
De: Daniel Rodrigues <notifications@github.com>
Enviado: Thursday, May 3, 2018 9:37:49 AM
Para: PHPJasper/phpjasper
Cc: hemimm; Mention
Assunto: Re: [PHPJasper/phpjasper] Support to Collections (#64)
Hi @hemimm<https://github.com/hemimm> please check your .jrxml report,
parameters should be used in this way:
$P{my_order_id}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#64 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AeEASsU0NrC_Pb4-nVidd5sMHnwI4lJJks5tuvodgaJpZM4PjUsa>.
|
Se o PhpJasper não é capaz de gerar este tipo de relatório, irei procurar outro tipo de gerador de pdf. Mas antes gostaria que se pronunciassem a respeito. |
Vamos encerrar a solicitação, considerando como NÃO RESOLVIDO. Se eu achar uma solução postarei para vocês. At. |
@hemimm PHPJasper é capaz de resolver sua demanda, acredito que exista algum problema de configuração aí, por favor verifique o manual com atenção. |
Daniel boa tarde!
Estou estudando os campos colocados no JasperSoft, até o momento verifiquei os seguintes:
O jrxml no PHP não está aceitando um IF que normalmente é aceito no JasperSoft:
Ex. $F{DESTEND}==null?"":$F{DESTEND}.trim()+","+$F{DESTNUM}
Não aceita também a função trim() e também a concatenação dos campos.
Neste momento estou verificando a interferência das imagens, que também não estão saindo no Relatório.
O próximo passo é verificar por que as etiquetas só saem em uma coluna e não em duas, conforme está no projeto e no JasperSoft funciona normalmente.
Manterei informado. Como auxílio gostaria que elucidasse de como analisar as configurações do PHPJasper, que na realidade não sei nem por onde começar.
At.
Enviado do Email<https://go.microsoft.com/fwlink/?LinkId=550986> para Windows 10
…________________________________
De: Daniel Rodrigues <notifications@github.com>
Enviado: Wednesday, May 9, 2018 11:29:24 AM
Para: PHPJasper/phpjasper
Cc: hemimm; Mention
Assunto: Re: [PHPJasper/phpjasper] Support to Collections (#64)
@hemimm<https://github.com/hemimm> PHPJasper é capaz de resolver sua demanda, acredito que exista algum problema de configuração aí, por favor verifique o manual com atenção.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#64 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AeEASmZymbf9fNGxinG69aWPCoKi06YMks5twv1EgaJpZM4PjUsa>.
|
Olá @hemimm, dê uma olhada no repositório de exemplos e estude um pouco mais de PHP, percebo que o problema não está na biblioteca. Take a look at the examples repository and study a little more of PHP, I realize that the problem is not in the library |
Daniel bom dia!
Não consegui visualizar onde está ocorrendo o problema no arquivo gerado pelo JasperSoftStudio para não ser compatível como PHPJasper.
Mas resolvi o problema com o MPdf e o Zint, que geram as etiquetas com imagem e datamatrix. As etiquetas geradas podem ter 2 ou mais colunas, 2 ou mais fileiras de etiquetas. Umas das vantagens é que ambos são compatíveis a partir da versão PHP5.
O MPdf é instalado através do Composer e o Zint com simples download.
At. Mitugi
Enviado do Email<https://go.microsoft.com/fwlink/?LinkId=550986> para Windows 10
…________________________________
De: Daniel Rodrigues <notifications@github.com>
Enviado: Wednesday, June 13, 2018 8:29:54 AM
Para: PHPJasper/phpjasper
Cc: hemimm; Mention
Assunto: Re: [PHPJasper/phpjasper] Support to Collections (#64)
Olá @hemimm<https://github.com/hemimm>, dê uma olhada no repositório de exemplos e estude um pouco mais de PHP, percebo que o problema não está na biblioteca.
Take a look at the examples repository and study a little more of PHP, I realize that the problem is not in the library
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#64 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AeEASojm9EgCdrOJX3iZK-13jG6Ij-kXks5t8PeygaJpZM4PjUsa>.
|
Daniel
Complementando. O Mpdf basta instalar pelo Composer localmente. No servidor só é transferido os pacotes locais. O Zint basta levar o seu executável no servidor. Os Relatórios pdf gerado funcionará (com Mpdf e Zint) tanto localmente como no servidor. Para geração de Relatórios pdf utilizei PHP e CSS, além do Mpdf e Zint
Concordo que se o jrxml elaborado pelo Jaspersoft Studio, gerasse o pdf diretamente com o PHP e PHPJasper, seria mais prático e direto. Infelizmente não deu.
At. Mitugi
Enviado do Email<https://go.microsoft.com/fwlink/?LinkId=550986> para Windows 10
…________________________________
De: Daniel Rodrigues <notifications@github.com>
Enviado: Wednesday, June 13, 2018 8:29:54 AM
Para: PHPJasper/phpjasper
Cc: hemimm; Mention
Assunto: Re: [PHPJasper/phpjasper] Support to Collections (#64)
Olá @hemimm<https://github.com/hemimm>, dê uma olhada no repositório de exemplos e estude um pouco mais de PHP, percebo que o problema não está na biblioteca.
Take a look at the examples repository and study a little more of PHP, I realize that the problem is not in the library
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#64 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AeEASojm9EgCdrOJX3iZK-13jG6Ij-kXks5t8PeygaJpZM4PjUsa>.
|
I don't know if is lack of my knowledge, but i can't discover how to pass parameters that in my report are of the Collection type. Do your library support it?
The text was updated successfully, but these errors were encountered: