GabrielVA
16th September 2011, 18:39
Working on a Packing Slip report, the user wants to be able to show a text field on the report if the item number (tdsls041.item) is a certain one. For example, if the number only shows up as item #12345, then this additional text populates on the report, every other number is left, blank.

Im thinking in the report script somehow make this field to yes or true or something if the item = 12345, but Im not sure how I would write it, then somehow use the output expression to switch this???

Could use some guidance with this please.

Thanks

bdittmar
16th September 2011, 18:46
Hello,
you can do it as print condition or in report script with lattr.print.

Use the right forum in future, please.

Think a moderator can move this thread to the DEV forum.

Regards

GabrielVA
16th September 2011, 20:42
OK thanks, so in my code for example, I should say in the report script:


field.tssls041.item:
before.print:
validate.textline()
if ( tssls041.item(1;1) = "123456" ) then
tdlit000.cofc2 = true
else
if ( tssls041.item(1;1) = "" ) then
tdlit000.cofc2 = false
endif
endif


tdlit000.cofc2 being my output expression in the Maintain reports Layout. Correct??

GabrielVA
16th September 2011, 21:41
Im thinking an easier way of doing it would be to say:


field.tdsls041.item:
after.display:
if tdsls041.item = BSB19-16AJ-05CSF then
flag = yes
endif
flag = no
endif


Then in the output expression simply say flag = yes

Any thoughts on doing it that way??

bdittmar
17th September 2011, 12:49
Im thinking an easier way of doing it would be to say:

field.tdsls041.item:
after.display:
if tdsls041.item = BSB19-16AJ-05CSF then
flag = yes
endif
flag = no
endif


Then in the output expression simply say flag = yes

Any thoughts on doing it that way??

Hello,

in the print condition of the reportfield:

tdsls041.item = "BSB19-16AJ-05CSF"

(item is type string !)

If you want to use a flag in reportscript :

layout.x:
before.layout:

|! i prefer boolean flags !


if tdsls041.item = "BSB19-16AJ-05CSF" then
flag = yes
|flag = true
else
flag = no
|flag = false
endif



Regards