Topic Options
#33686 - 10/25/10 03:11 PM if then and compare
A Plus Letter Offline
OL Newbie

Registered: 04/10/08
Posts: 15
Loc: USA
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.

Top
#33687 - 10/25/10 03:21 PM Re: if then and compare [Re: A Plus Letter]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4953
Loc: Objectif Lune Montreal
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!

Regards,
Raphaƫl Lalonde Lefebvre

Top