cancel
Showing results for 
Search instead for 
Did you mean: 

FormCalc: format border color for data in table

Former Member
0 Kudos

I am new in scripting language so I seek your patience if my question seems to be obvious.

I need to put different color (let say: red) to the bottom border/line for all lines of the data in a table.

My palette hierarchy looks like the following screen shot:

I have been trying with one column TANUM (i.e. TO No.) and put the following FormCalc script in the even "initialize":


var Reihen = data.Page1.Output_table.IT_OUTPUT._DATA.count-1

for i=0 upto Reihen do data.Page1.Output_table.IT_OUTPUT.DATA[i].TANUM.border.getElement("edge",2).color.value = "255,0,0"

endfor

When I run it does color the Column TANUM with the color Red, but only for the last line of the data on the second

column (TANUM / TO No.) of each page, as seen below:

I am really desperate because I have tried with other events:

Validate, form:ready, layout:ready, docReady

but the result is always the same!

If I put the following script in the event Calculate :

data.Page1.Output_table.IT_OUTPUT.DATA.TANUM.border.getElement("edge",2).color.value = "255,0,0"

the effect for all lines can be seen, BUT the content of the column TANUM (To No.) is replaced by the numbers of the color coding!

So my question is: how can apply it to ALL lines of the data?

Thanks for your help in advance.

Regards,

Sunny

Accepted Solutions (0)

Answers (1)

Answers (1)

ali_eshaghibeni
Participant
0 Kudos

hi

i dont know i get it right or not but it seem you want to change the color of bottom boder of all TANUM fields.

my question is if you just simply want to change all TANUM fields color why would you want to use script language?

you can easily select your TANUM field then in Object palette choose Appearance select Custom and in new window you can change border color and style Individually.

I think by using this method this style apply to all row of your table( of curse only TANUM field) .

Former Member
0 Kudos

Hi Ali,

many thanks for your response. I am aware of the static formatting of the border you showed

above. Initially I explored that possibility until I realize that it works fine only for a static definition.

The formatting using the FormCalc scripting technique is just a temporary step for me to

simplify my question.

Once I get the answer, I would then build in further IF-ENDIF statement to define the

requirement when the bottom border color is to be changed.

Referring to my second screen shot above, my objective(final result) is:

If the contents of the Col. "TONo." are the same in subsequent rows (which is the case for row1 and row2) then I would group them together visually by setting the bottom border of the row1 (i.e. for all columns of row1) invisible (i.e. setting the color to White). Hence, just imagine that the horizontal bottom line of row1 would be invisible.

I deliberately use the color Red in this post to make it easier to be spotted.

As an alternative to setting the color to white I think there is also a FormCalc function to set it invisible.

But at this stage I would be very happy already if I only knew which event I should put the script into.

In case you are interested: I am forced to use scripting because I am adapting a SAP Smartform to Adobe Print Form. In the Smartform it was implemented by simply putting a condition to the object Folder that contains the text object underline (_________________).

My apologize if my post above has caused a misinterpretation.

ali_eshaghibeni
Participant
0 Kudos

Hello

i should have known that it must be a bigger idea behind your request ( as i could guess).

its now when im thinking about your scenario i think if i were you i would prefer to choose the idea of grouping instead of using unfamiliar scripting of ADOBE, maybe it is easy but not always.

do about this grouping idea i have read before in this book:

SAP Interactive Forms by Adobe. of Stephan Rehmann, Thomas Szücs, Jürgen Hauser, Andreas Deutesfeld...

but you can find some example here and then it become clear for you:

Grouping Tables by Data Fields - SAP Interactive Forms by Adobe - SAP Library

i dont know how much this idea can be helpful for you but when im looking at all forms and application it is always like this:

it might fulfill your requirement but it can be a bit different to what you expect, i mean visually.

Look at this PDF file and see how you can use grouping:

http://help.adobe.com/en_US/livecycle/9.0/lcdesigner_qs_poform.pdf

this is another example from sappress book but this one need use page break in table you can do a lot with this ability:

hope this help you,