This one has been a head scratcher for 2 days now. I have code that I want to show a bar code or show a default image. I want to show the default image if the value I am using to generate the barcode is blank. I am using a DLL from CodeProject to generate the barcode and the default image is stored in SQL Server. This is done in image properties using an expression. The strangeness is that I can render either one via the expression as long as it is by itself. As soon as I put them together, the barcode will generate but NOT the image I have stored in the DB. I started using the IIF which should work but when it was not working I moved to using SWITCH. I get the same results. If the value to produce the barcode is blank, instead of the image from the DB, it [b]just shows a thumbnail[/b]. Otherwise, the Barcode image [b]ALWAYS [/b]shows if the condition is true.Below is the code I currently have that is [b]NOT[/b] working:[b]=SWITCH(Len(First(Fields!PRO.Value, "Carrier")) <= 0, First(Fields!PROLabelImage.Value, "Carrier"),Len(First(Fields!PRO.Value, "Carrier")) >= 0, Code.Convert(First(Fields!PRO.Value, "Carrier")))[/b]If I run it like this (Value from the DB):[b]=SWITCH(Len(First(Fields!PRO.Value, "Carrier")) <= 0, First(Fields!PROLabelImage.Value, "Carrier"))[/b]or this (DLL function to create Barcode):[b]=SWITCH(Len(First(Fields!PRO.Value, "Carrier")) >= 0, Code.Convert(First(Fields!PRO.Value, "Carrier")))[/b]It will render ( giving that the condition exists)Has anyone else ran into this?Greatly appreciate any assistance.
↧