Coder Social home page Coder Social logo

$P!{name} Parameters about jasperphp HOT 11 CLOSED

quilhasoft avatar quilhasoft commented on June 20, 2024
$P!{name} Parameters

from jasperphp.

Comments (11)

gamadoleo avatar gamadoleo commented on June 20, 2024

Can anyone pass these parameters?

from jasperphp.

Rctnet avatar Rctnet commented on June 20, 2024

Hi,
this is a complex sql, i use it in my systems
SELECT p.proprietarios_codigo,
p.proprietarios_nome,
cc.cc_terceiros_codigo,
cc.bancos_codigo,
cc.cc_terceiros_agencia,
cc.cc_terceiros_conta,
cc.cc_terceiros_tipo,
cc.cc_terceiros_titular,
cc.cc_terceiros_cnpjcpf,
l.locacoes_codigo,
b.bancos_nome
FROM locacoes l
JOIN imoveis_proprietarios ip ON ip.imoveis_codigo = l.imoveis_codigo
JOIN cc_terceiros cc ON cc.cc_terceiros_codigo = ip.cc_terceiros_codigo
JOIN proprietarios p ON p.proprietarios_codigo = ip.proprietarios_codigo
JOIN bancos b ON b.bancos_codigo = cc.bancos_codigo
JOIN eventos_locacao evl ON l.locacoes_codigo = evl.locacoes_codigo
WHERE evl.proprietario_dta_venc >= "$P{dta_repasse_inicial}"
AND evl.proprietario_dta_venc <= "$P{dta_repasse_final}"
AND evl.situacao = "NOR"
$P{rd_filtrar_pagos} //here pass a complex condition part of sql ex.: AND foo = bar AND tree = wood
$P{rd_filtrar_prop_imov}
$P{rd_filtrar_repassados}
GROUP BY p.proprietarios_codigo,cc.cc_terceiros_conta
ORDER BY p.proprietarios_nome ASC

from jasperphp.

gamadoleo avatar gamadoleo commented on June 20, 2024

I understand, in making filters based on individual parameters, but that makes the sql assembly much more complex... something that in the application there are many filters and makes them dynamic, so when passing the formulated parameter already as a kind of p_where, it makes it easier the process a lot, and as I said that way jasperreport native jasper api supports... and it makes it much easier to use this type of parameter, with that I pass a completely customized p_where.

from jasperphp.

Rctnet avatar Rctnet commented on June 20, 2024

ok,i think to support it,
what you pass in ($ P! {p_where}) parameter?

from jasperphp.

gamadoleo avatar gamadoleo commented on June 20, 2024

step a sql ex:
select * from person where ($P!{p_where})
I pass a sql in the parameter
p_where = city_id=10 and neighborhood_id=25

final result
select * from person where (city_id=10 and neighborhood_id=25)

just an example, that is, I pass a sql script that filters the records, so I can pass a very complex sql with several filters...

from jasperphp.

Rctnet avatar Rctnet commented on June 20, 2024

try this ($P{p_where}) without "!"
select * from person where ($P{p_where})
and pass a sql in the parameter
p_where = city_id=10 and neighborhood_id=25

from jasperphp.

gamadoleo avatar gamadoleo commented on June 20, 2024

Without ! seems to solve yes... because I did a debug printing the generated sql and now yes it is generating correctly... but I have other problems in the report anything I open another post. Here's just one suggestion that I inform you is the possibility of changing the patch directory of ini config files for database connection because in my case, I already have this file pattern because I also use PDO so I wanted to use the same files...
One question what makes a report slow? because I'm testing your library I already use the report with jar JasperStart but your generated even slower... I didn't understand.

from jasperphp.

Rctnet avatar Rctnet commented on June 20, 2024

About PDO, i use one solution, runs perfect for me, you can change on line

//use TTransaction;

and implement a copy of Transaction Class, but taking connection parameters in your config file.
About slow reports, i think that much objects can make report slower, i have in my systems reports what generate mor then 60 pages in less of 6 seconds, containing 3 level sub reports with querys, passing parameters end receiving totalizers.

from jasperphp.

gamadoleo avatar gamadoleo commented on June 20, 2024

JasperPHP\ado\TTransaction::open("dev");

when I refer to changing the patch, I refer to the possibility, for example, of changing the directory where the dev.ini file is, or even some parameter that says that a complete patch of the file is being passed, because as I said, I already have files in another folder ini config files and didn't want to be duplicating the config files

from jasperphp.

Rctnet avatar Rctnet commented on June 20, 2024

Add the solution

if (file_exists($name))

pass full path of file including extension

from jasperphp.

gamadoleo avatar gamadoleo commented on June 20, 2024

yes..

from jasperphp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.