Re: Using parameter in datasource condition

Kishan Bhat <[email protected]> Mon, 14 Mar 2011 08:43:19 +0530
Newsgroups gmane.comp.gnu.enterprise.general
Message-ID <[email protected]>
--===============1635667772==
Content-Type: multipart/alternative; boundary=0023545309708d7fb3049e68b17b

--0023545309708d7fb3049e68b17b
Content-Type: text/plain; charset=ISO-8859-1

I looked into tools/common/src/datasources/GConditions.py - def
getXMLelements, and it had all the clues!!

and I was able to use:
*<cparam name="printInvId"/>*

On Mon, Mar 14, 2011 at 8:30 AM, Kishan Bhat <[email protected]> wrote:

> Hello All,
>
> Can I use parameter values inside datasource condition definition? I've
> underlined the line of interest, the excerpt from my report.grd xml
>
> =============================
>   <parameters>
>      <parameter name="printInvId" description="Invoice ID" default="0"/>
>   </parameters>
>
>   <sources>
>    <datasource database="mipltest" name="dts_invoice_item"
> table="invoice_item">
>     <condition>
>     <and>
>    <eq>
>     <cfield name="uid_invoice"/>
> * **  ** **<cconst value="printInvId"/>*
>     </eq>
>    <gt>
>     <cfield name="quantity"/>
>      <cconst value="0"/>
>    </gt>
>    </and>
>     </condition>
>    </datasource>
>   </sources>
> =============================
>
> I need to generate reports for a specific invoice id only, by passing the
> id as a parameter.
>
> Thanks,
> Kishan
>

--0023545309708d7fb3049e68b17b
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div>I looked into tools/common/src/datasources/GConditions.py -=A0def getX=
MLelements, and it had all the clues!!</div><div><br></div><div>and I was a=
ble to use:</div><div><i><u>&lt;cparam name=3D&quot;printInvId&quot;/&gt;</=
u></i></div>
<div><br><div class=3D"gmail_quote">On Mon, Mar 14, 2011 at 8:30 AM, Kishan=
 Bhat <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]">kishanb=
[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>Hello All,</div><div><br></div><div>Can I use parameter values inside =
datasource condition definition? I&#39;ve underlined the line of interest, =
the excerpt from my report.grd xml</div><div><br></div><div>=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</d=
iv>

<div>=A0=A0&lt;parameters&gt;</div><div>=A0=A0 =A0 &lt;parameter name=3D&qu=
ot;printInvId&quot; description=3D&quot;Invoice ID&quot; default=3D&quot;0&=
quot;/&gt;</div><div>=A0=A0&lt;/parameters&gt;</div><div><br></div><div>=A0=
=A0&lt;sources&gt;</div>

<div>=A0=A0 &lt;datasource database=3D&quot;mipltest&quot; name=3D&quot;dts=
_invoice_item&quot; table=3D&quot;invoice_item&quot;&gt;</div><div>=A0=A0<s=
pan style=3D"white-space:pre-wrap">	</span>=A0&lt;condition&gt;</div><div>
<span style=3D"white-space:pre-wrap">		</span>=A0=A0=A0&lt;and&gt;</div><di=
v><span style=3D"white-space:pre-wrap">			</span>=A0=A0=A0&lt;eq&gt;</div><=
div>=A0=A0<span style=3D"white-space:pre-wrap">				</span>=A0&lt;cfield nam=
e=3D&quot;uid_invoice&quot;/&gt;</div>

<div><span style=3D"white-space:pre-wrap"><i>		</i></span><i>=A0=A0</i><spa=
n style=3D"white-space:pre-wrap"><i>	 	</i></span><i><u>&lt;cconst value=3D=
&quot;printInvId&quot;/&gt;</u></i></div><div>
<span style=3D"white-space:pre-wrap">			</span>=A0=A0=A0&lt;/eq&gt;</div><d=
iv><span style=3D"white-space:pre-wrap">			</span>=A0=A0=A0&lt;gt&gt;</div>=
<div><span style=3D"white-space:pre-wrap">				</span>=A0=A0 =A0&lt;cfield n=
ame=3D&quot;quantity&quot;/&gt;</div>

<div><span style=3D"white-space:pre-wrap">				</span>=A0=A0 =A0&lt;cconst v=
alue=3D&quot;0&quot;/&gt;</div><div><span style=3D"white-space:pre-wrap">		=
	</span>=A0=A0=A0&lt;/gt&gt;</div><div><span style=3D"white-space:pre-wrap"=
>		</span>=A0=A0=A0&lt;/and&gt;</div>

<div><span style=3D"white-space:pre-wrap">	</span>=A0=A0=A0&lt;/condition&g=
t;</div><div>=A0=A0 &lt;/datasource&gt;</div><div>=A0=A0&lt;/sources&gt;</d=
iv><div>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D</div><div><br></div><div>I need to generate reports f=
or a specific invoice id only, by passing the id as a parameter.</div>

<div><br></div><div>Thanks,</div><div>Kishan</div>
</blockquote></div><br></div>

--0023545309708d7fb3049e68b17b--


--===============1635667772==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
gnue mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnue

--===============1635667772==--