Tuesday, 18 March 2014

BI Publisher Conditional Character Spacing on a Field

I have just come across an interesting issue  that took a little bit of brain scrambling to sort out.  I had a field that I had to display in two different ways 

 if the field was on the last page of my document I needed to display the date  with 2 spaces between each of the characters   a bit like 1  8  0  3  2  0  1  4

for any other page i had to display     "***VOID***" with normal spacing.

now id managed to get my if statement working fine  to display eather the date or void but the spacing issue became a major headache.

i tried all sorts of XSL_FO combinations to no avail  them a eureka moment .  I could add two fields . id use word to increase the character spacing on one field   and leave the second field with normal spacing.

in the absence of discovering a better way to do it all in one field (Hope fully some one more experienced can sugest that)  hers the code in my feilds  that i used to resolve the issue


word field formatted to double space the chars 
<?xdoxslt:ifelse(Current_stub_number___Local_ID46 !=  Stub_Total___Local_ID66, '' ,G_L_Date2___Local_ID64)?>


second word field formatted as normal 
<?xdoxslt:ifelse(Current_stub_number___Local_ID46 !=  Stub_Total___Local_ID66, ' * * * VOID * * * ' ,'')?>


to increase the spacing on the first field  clicking on the little arrow at the bottom of the font  ribbon brings up the following where you can  increase and decrease character spacing over a field paragraph etc etc in word


so eather the single spaced or the double spaced field is shown 

No comments:

Post a Comment