Subject |
Re: CODEBLOCK IN DETAIL BAND |
From |
Mervyn Bick <invalid@invalid.invalid> |
Date |
Thu, 20 Jul 2017 10:31:03 +0200 |
Newsgroups |
dbase.getting-started |
On 2017-07-20 9:38 AM, Mustansir Ghor wrote:
> Dear All
>
> I have a scenario where any one field out of these three fields RESULTL (this is using lookupSQL for data display), RESULTN, RESULTM need to be printed in a tabular report. The criteria for field selection is stored in the fourth field RESULTY ("N", "C", "L")
>
> NAME RESULT
> -------------------------------------
> Malaria Positive (RESULTL)
> HB 8.0 (RESULTN)
> SENSITIVITY No growth (RESULTC)
>
>
> Is there any means of using codeblock with text object to achieve this.
>
Try the following.
Instead of dragging resulty from the fields palette to the detailband
place a plain text object where you want the actual result to be placed.
Use the text object's canRender event handler to control the output
function TEXT1_canRender()
if this.form.YourQueryName.rowset.fields["resulty"].value = 'L'
this.text = this.form.YourQueryName.rowset.fields["resultl"].value
elseif if this.form.YourQueryName.rowset.fields["resulty"].value
= 'N'
this.text = this.form.YourQueryName.rowset.fields["resultn"].value
elseif if this.form.YourQueryName.rowset.fields["resulty"].value
= 'C'
this.text =
this.form.YourQueryName.rowset.fields["resultc"].value
endif
return true
Mervyn.
|
|