Jump to content
We've recently updated our Privacy Statement, available here ×

variable and text field expressions


sgayathrii

Recommended Posts

hai friends...

 

i like 2 know hw to use this variable and text feild expressions in ireports.Can you guide me plz

 

my condition is like this...

say according to a 'status' field tat iam getting from query... i need to pass 'YES' or 'NO' string values to three other fields...

 

for these three field can i use variable expression or text field expression? whichever may b... tel me how to assign string values to these expressions...

 

its urgent... need ur help...

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Don't know if I understood your problem right but here my thoughts:

 

Your Boolean-StatusField from query: $F{YourStatusBooleanField} that is TRUE or FALSE

 

Your Textfield-1: $F{YourTextField1}

Your Textexpression for that field should be:

 

$F{YourStatusBooleanField}? $F{YourTextField1} + " YES":$F{YourTextField1} + " NO"

 

Means in simple minds: append the String " YES" to your first Textfield if your statusfield is TRUE.... otherwise append String " NO".

 

Do the other two fields of course the same way!

 

That's how I did interprete your question, if wrong please post again (more precisely).

 

hth

C-Box

Link to comment
Share on other sites

thanks for ur response friend..

the option wat u hav given is compiling with no errors, but the output wat iam aiming is not cming..

but i like explain more clearly the way i want the output.

this is my query..

" select dt.dist_ename,tk.taluk_ename, vi.vill_ename, substring(wkf.landrecid,8,2) as surveyno,

wkf.status as status from

workflowtable wkf ,village vi, taluk tk, district dt where substring(wkf.landrecid,3,2)=vi.taluk_code and

substring(wkf.landrecid,1,2)=vi.dist_code and substring(wkf.landrecid,5,3)=vi.vill_code and

substring(wkf.landrecid,3,2)=tk.taluk_code and vi.taluk_code= tk.taluk_code and

substring(wkf.landrecid,1,2)=tk.dist_code and vi.dist_code = tk.dist_code and

substring(wkf.landrecid,1,2)=dt.dist_code and vi.dist_code = dt.dist_code and tk.dist_code = dt.dist_code

and wkf.status='F' and dt.dist_code = '23' and tk.taluk_code='03' and

vi.vill_code = '007' and wkf.createdtime::date between '2006-01-01' and '2006-09-30'

 

UNION

 

select dt.dist_ename,tk.taluk_ename, vi.vill_ename, substring(wkf.landrecid,8,2) as surveyno,

wkf.status as status from

workflowtable wkf ,village vi, taluk tk, district dt where substring(wkf.landrecid,3,2)=vi.taluk_code and

substring(wkf.landrecid,1,2)=vi.dist_code and substring(wkf.landrecid,5,3)=vi.vill_code and

substring(wkf.landrecid,3,2)=tk.taluk_code and vi.taluk_code= tk.taluk_code and

substring(wkf.landrecid,1,2)=tk.dist_code and vi.dist_code = tk.dist_code and

substring(wkf.landrecid,1,2)=dt.dist_code and vi.dist_code = dt.dist_code and tk.dist_code = dt.dist_code

and wkf.status='C' and dt.dist_code = '23' and tk.taluk_code='03' and

vi.vill_code = '007' and wkf.checkingtime::date between '2006-01-01' and '2006-09-30'

 

UNION

 

select dt.dist_ename,tk.taluk_ename, vi.vill_ename, substring(wkf.landrecid,8,2) as surveyno,

wkf.status as status from

workflowtable wkf ,village vi, taluk tk, district dt where substring(wkf.landrecid,3,2)=vi.taluk_code and

substring(wkf.landrecid,1,2)=vi.dist_code and substring(wkf.landrecid,5,3)=vi.vill_code and

substring(wkf.landrecid,3,2)=tk.taluk_code and vi.taluk_code= tk.taluk_code and

substring(wkf.landrecid,1,2)=tk.dist_code and vi.dist_code = tk.dist_code and

substring(wkf.landrecid,1,2)=dt.dist_code and vi.dist_code = dt.dist_code and tk.dist_code = dt.dist_code

and wkf.status='A' and dt.dist_code = '23' and tk.taluk_code='03' and

vi.vill_code = '007' and wkf.approvaltime::date between '2006-01-01' and '2006-09-30' "

 

in this query iam having a 'status' field... wen status is 'F' then i should generate three more fields in my report with 'Yes', 'No' , 'No' as values..

similarly in case of 'C' the three fields values must b 'Yes', 'Yes', 'No'

and for 'A' the values wil be 'Yes', 'Yes', 'Yes'.

hw can i get this?

as u said before.. iam nt having any boolean field here..

can i use variable expression here in these cases?

thanks in advance

gayathri

Link to comment
Share on other sites

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...