if then and compare

Posted by: A Plus Letter

if then and compare - 10/25/10 03:11 PM

Can someone help me with If then and compare expressions. We want to be able to pull in different PDF's based on 2 different fields.
Posted by: Raphael Lalonde Lefebvre

Re: if then and compare - 10/25/10 03:21 PM

A Plus Letter,

Put an image box on your page, then right-click on it to access it's expression editor. You can then use conditions for the file name and path, and incorporate fields. Example:

IF([Region] = "A", "C:\files\RegionA.pdf", "C:\files\RegionB.pdf")

This will make a comparison on the [Region] field, and load either the pdf RegionA or RegionB. Another example:

IF([ID] = "1", "C:\files\" & [PDFName] & ".pdf", "C:\files\default.pdf")

In this case, if the [ID] field is equal to 1, it will load the pdf with the name contained in the [PDFName] field. Since that name doesn't include the extension, we concatenate it. If [ID] isn't equal to 1, we load default.pdf.

These are just some examples on how you can do it, but that should give you a good start for your own situation.

Hope that helps!

Raphaƫl Lalonde Lefebvre