Using an IIF statement on the Job Trav report to show or hide certain fields

I need to modify our jobtrav so that when certain operations appear, it will display one textbox, but if its anything else, it will display a different textbox. i have gotten this to work in the past by using the full operation code but in this case im trying to make it easier by using some kind of “starts with” or “begins” callout. I am very inexperienced with all of this so ive tried some sql commands ive found but i dont think sql is the right language fpr this…

The current way im doing it is by entering:

  `=IIf(Fields!OpCode.Value="Operation"   ,TRUE,FALSE)` 

…I have a list of 38 operations that all begin with the word VENDOR, can i add a flag somewhere so i can say:

 `IIF(Fields!OpCode.Value (beginswith) "Operation"   ,TRUE,FALSE)`

Mr. Joe: You may want to consider:
iif(InStr(Fields!OpCode.Value, “Oper”) > 0, true, false)

InStr returns the starting position of the search string - if not found it returns zero.

DaveO

Hey Dave, thanks for the reply. So to be specific in our case, i have a bunch of operations that start with VENDOR - xxxxxxxxx…the x’s can be a number of different things so if i enter in VENDOR where you put Oper, will that only pay attention to things having VENDOR in it?

IIF(Fields!OpCode.Value LIKE 'VENDOR%', TRUE, FALSE)

In this case, it will check if the OpCode field starts with “VENDOR” and ignore any characters that come after “VENDOR.” So, it will return TRUE for fields like “VENDOR - ABC,” “VENDOR - XYZ,” etc., and FALSE for fields that don’t start with "VENDOR.

1 Like

Thanks Aaron, im going to give this a shot now…this project got put to the side for the past month so now that things are quiet ill give it a shot and let you know!

1 Like

FWIW I have always had to use 1 and 0 instead of true and false when defining the calculated value for a bit field in the BAQ. In the RDL you have to use true and false. So confusing!
I use the hiding expression in RDL a lot. It works alright if you know exactly what you are showing and hiding.

1 Like