Jump to content
Changes to the Jaspersoft community edition download ×

Parameter in query


rafael_baraunaa

Recommended Posts

Hello, 

 

I'm having trouble passing the parameter for the query , 

I managed to pass the php values to jasper,

the dates and values ​​, but not can pass the values ​​for the query , 

I tried to pass putting $ p! { value} , 

does anyone know why the parameters do not pass ?

 


<parameter name="Data_inicio" class="java.lang.String">

<parameterDescription><![CDATA[]]></parameterDescription>

</parameter>

<parameter name="Data_final" class="java.lang.String"/>

<parameter name="Empresa" class="java.lang.String">

<parameterDescription><![CDATA[]]></parameterDescription>

</parameter>

<parameter name="Tipo" class="java.lang.String"/>

 


<queryString>

<![CDATA[sELECT                                         

                                    pes.Cod_pesagem,

                                    pes.Peso_bruto,

                                    pes.Peso_tara,

                                    pes.Peso_liquido,

                                    pes.Peso_rejeito,

                                    pes.tipo,                                     

                                    CONVERT(nvarchar(30), pes.Databruto, 103) as Databruto,

                                    CONVERT(nvarchar(30), pes.Datatara, 103) as Datatara,

                                    pes.Placa,              

                                    pn.cod_pn,

                                    pn.parceiros_negocio,

                                    prod.Cod_Produto,

                                    prod.Produto,

                                    motor.cod_motorista,

                                    motor.motorista,

                                    emp.cod_empresa,

                                    emp.empresa

 

                                            FROM

                                            PESAGEM pes

                                            INNER JOIN EMPRESA as emp ON (pes.Empresa = emp.cod_empresa)

                                            INNER JOIN PARCEIRO_NEGOCIO pn ON (pes.Cod_PN = pn.cod_pn)

                                            INNER JOIN PRODUTO prod ON (pes.Cod_Produto = prod.Cod_Produto)

                                            INNER JOIN MOTORISTA motor ON (pes.Cod_Motorista = motor.cod_motorista) 

                                            WHERE cast(Data_concluido as date) >= $P{Data_inicio}

                                            AND cast(Data_concluido as date) <= $P{Data_final}

                                            AND pes.tipo = $P{Tipo}

                                            AND pes.Empresa = $P{Empresa}]]>

</queryString>

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...