1

I'm putting together a report in the BI Publisher Word .rtf plugin with very specific layout needs. One of those needs is the ability to switch company logos depending on parameters entered. I've been using conditional fields to selectively display each logo, but for some reason I can't reference data fields in the conditional code.

I've used these methods:

<?if: column_name = 'desired_value'?> [logo1] <?end if?> 

<?choose:?><when: column_name = 'desired_value'?> [logo1] <?end when?>

Both of these methods seem to work when given raw values (i.e. instead of column_name = desired_value, I used 1=1 and it printed) but not when I use the name of the column I'm trying to compare.

For a more concrete example:

<?if: p_jno_in > 0?>

is always false, as if p_jno_in is null rather than having a value. (this variable represents the job number of the report and will never be null, even in my test data/sample xml.)

EDIT: Here is an example of what I've used, and the output.

tmnsquirtle
  • 11
  • 1
  • 3
  • Did you try `` ? – ColdSurgeon25 Oct 25 '19 at 20:32
  • Yeah, that ended up being null as well. – tmnsquirtle Oct 28 '19 at 16:15
  • The example you are giving can not work because the text you are trying to print is being interpreted as code. Instead of trying to print ` 0?>`, just print text like `p_jno_in > 0`. If you include the `` and `?>` it will be interpreted, even if it isn't in a BI Publisher field. – Based Nov 04 '19 at 13:57

2 Answers2

0

If you host the image on the server, you can do all sorts of stuff with BI Publisher logic and concatenating an image path string. Make sure you or your DBA makes the path readable by BI Publisher. They can also map it to an FTP connection so you can edit/add images without being in Unix.

  1. Insert any dummy placeholder image in RTF template (Insert Picture)
  2. Right click on image and click “Edit Alt Text” and enter dynamic path. (See below for example)

url:{concat('${OA_MEDIA}/XX_LOGOS',/XML_PATH/LOGO_NAME,'_','small','.jpg')}

Other older versions of Word may have this data stored in the Size/AltText or Format Picture/Web menus

EdHayes3
  • 1,777
  • 2
  • 16
  • 31
0

I looked around a bit and found the answer to my question. Turns out I was actually using the correct format the whole time! The issue was actually that I was referencing fields inside a for-each grouping, which I think might limit the scope. So, for example, if my BI Publisher data model has a query block A that has been split into two groups AA and AB, trying to reference a field from AA when you're in a for-each looping on an element from AB will not work.

Tmnsquirtle
  • 3
  • 1
  • 3
  • Would you give an example of correct XPath? I tried a few different methods (specifying the group name, specifying the path with group\group\element notation, etc) but wasn't able to guess at the correct syntax apparently. – Tmnsquirtle Nov 05 '19 at 17:29
  • Well if you are being limited by a for-each loop, meaning you are in a branch of the xml tree, you can get back to the root by using `//` and then specify the full path. – Based Nov 13 '19 at 15:13