cancel
Showing results for 
Search instead for 
Did you mean: 

Adobe Form - Print choice of bold or not bold font

Former Member
0 Kudos

We have an Adobe form that prints sales order line items that are followed by their scheduling data (if any). So, each order line item could be followed with one or more scheduling line items or none. Example:

(Order line) 10 9055450 7,000 EA <other data>

(Schedule lines Expected Ship Date: 5,000 EA 05/30/2011

for the order line) Expected Ship Date: 2,000 EA 07/16/2011

This is working fine using a subform but now we want to print the scheduling line items either as bold or not bold depending on some logic. So, we want this:

(Order line) 10 9055450 7,000 EA <other data>

(Schedule lines Expected Ship Date: 5,000 EA 05/30/2011

for the order line) Expected Ship Date: 2,000 EA 07/16/2011

We have an indicator set for each scheduling line item that indicates if the schedule line is to be printed as bold or not bold (schedules-bold_line = u2018Xu2019).

Is there any way to override the font settings in the Layout using Script Editor?

Weu2019ve tried using Script Editor (at a upper level subform) to set the presence (hidden/visible) of two different subforms (one to print as bold and one not bold) but that printed both subforms.

Weu2019ve tried using Alternative nodes (true/false) that check the bold line indicator. This works but it prints the wrong data because there are direct binding references to multiple levels of repeating data. That is, instead of printing the schedule lines for order line item 10, it prints the schedule line items for order line item 20.

(Order line) 10 9055450 7,000 EA <other data>

(Schedule line Expected Ship Date: 1,000 EA 06/01/2011

for the next order line)

How would I use relative binding in Alternative nodes?

Is there a better method to accomplish this task?

Any help is greatly appreciated.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member

Radhika - Thank you so much for your answer! You helped me find the solution. I ended up using FormCalc and this is the code that worked in the Ready Layout event of the EXPECTEDSHIPDATE subform :

data.BODY_PAGE.TABLE.ITEM_VALUES.ZLINE.TEXTSUBFORM.EXPECTEDSHIPDATE::ready:layout - (FormCalc, both)

if ( $.BOLD_LINE_IND[*] == "X" ) then

$.ShipQty[*].font.weight = "bold"

$.ShipQty[*].caption.font.weight = "bold"

$.DelvDate[*].font.weight = "bold"

$.UOM[*].font.weight = "bold"

$.PlantName[*].font.weight = "bold"

$.PlantName[*].caption.font.weight = "bold"

else

$.ShipQty[*].font.weight = "normal"

$.ShipQty[*].caption.font.weight = "normal"

$.DelvDate[*].font.weight = "normal"

$.UOM[*].font.weight = "normal"

$.PlantName[*].font.weight = "normal"

$.PlantName[*].caption.font.weight = "normal"

endif

The EXPECTEDSHIPDATE subform is bound to the Schedules table that contains ShipQty, etc. The BOLD_LINE_IND field contains the value that toggles the print between bold and normal.

The key to making this work was to correctly format the condition and code and to find the right event to place the code in.

Thanks again for your help!

Former Member
0 Kudos

Hi Doris,

For dynamically changing the font weight, you can use following code:

if (<condition>){

xfa.resolveNode("data.form1.Name1").font.weight = "bold";

}

Hope this helps.

Thanks,

Radhika