I'm converting crystal reports over to SSRS and need to put the equivalent of this if statement in an expression.
if({RPT_ReceiptStatusHeader.receipt_id_type} = "Trailer ID") then
BarcodeC128B({RPT_ReceiptStatusHeader.trailer_id})
else
BarcodeC128B({RPT_ReceiptStatusHeader.receipt_id_type})
BarcodeC128B({RPT_ReceiptStatusDetails.item})
Here is what I've come up with but this is incorrect.
=IIf(RPT_ReceiptStatusHeader.receipt_id_type = "Trailer ID", StringToBarcode({RPT_ReceiptStatusHeader.trailer_id}), StringToBarcode({RPT_ReceiptStatusHeader.receipt_id_type}), BarcodeC128B({RPT_ReceiptStatusDetails.item})
The syntax for an SSRS if else is for example....
=IIF(Fields!LineTotal.Value > 100, True, False)
But how can I put multiple statements in the false condition?
Are you trying to create 2 barcodes with this? With barcodes, I'm assuming that you would want them separated vertically (so that they are one above the other, since putting them next to each other would make accurate scanning very problematic). If this is the case, then I would try something along the lines of:
=IIf(RPT_ReceiptStatusHeader.receipt_id_type = "Trailer ID",
StringToBarcode({RPT_ReceiptStatusHeader.trailer_id}),
StringToBarcode({RPT_ReceiptStatusHeader.receipt_id_type}) & chr(10) &
StringToBarcode({RPT_ReceiptStatusDetails.item})
What you will end up with is 2 barcodes oriented one above the other. You will have to handle font size and possibly even the height of the control.
BTW - I changed the "BarcodeC128B" to "StringToBarcode" in the second part of the "then" portion of your statement.
BTW2 - I'm feeling your pain with the CR to SSRS conversion. We're making the conversion ourselves and have most of the easy (scheduled and "on demand") work done, we just have a couple hundred application based reports to convert over.