I have a field where I want to left trim everything before a statement within a string. I am attempting to handle this within a textbox instead of doing a calculated field.
My understanding is that the IIF statement says “If Fields!MfgComment.Value contains “MyStatement:” then left trim MfgComment from the beginning to the start of “MyStatement:” else use MfgComment as is”.
The rest of the first wrap and char replacements are just to handle new line statements.
However, if “MyStatement:” isn’t detected then the textbox errors:
If I’m understanding the question, it is because SSRS processes both true and false conditions regardless of the actual condition… I’ve personally been victim of this so you have to rewrite your iif statement in such a way that both true and false statements will be “valid”.
This link explains a little bit more about the phenomenon and even mentions InStr as a common culprit. This may not be the answer but I think it will direct you to a way around it. IT Help and Advice: SSRS: Common Issues with #Error and IIF
Wow, the thanks is mutual. I didn’t realize that I could use IF instead of IIF. I guess IIF is the same concept as CASE. I can see in report writing why IF usually may not suffice… but as long as you include an ELSE it should be fine.