Hello all,
I am new to this website. I dont know if this is the right place to post issues like this but Ill give it a try although someone might through a rock at me.
I have been scripting for a couple of years in ARIS and have found a couple of bugs, I have been trying to submit these to the ARIS support but with no luck. I thought I might give this a try.
However, right now I am working on a script which is copying textoccs and I have a problem with the fontstyle. It works for the non attribute textoccs but not for the attribute ones.
Textocc1 does have character formatting and is bold.
When I create Textocc2 I use the textdef of Textocc1.
I checked the FontStyleSheet of Textocc1 and it says nothing about bold style, I also tried to set it myself with setFontStyleSheet.
FontStyleSheet().Font(loc).Style() = 0
Apparently the scripting module cant handle character formatted text, is that right?
Also, if I set the Style to bold manually it doesnt work. Is it just me or has anyone gotten this to work?
Im using ARIS IT Architect 7.1
/Robert
Hi Robert,
the way to set bold font in a font style sheet is the following:
[myFontStyleSheet].Font( Context.getSelectedLanguage() ).setStyle( Constants.FMT_BOLD )
You can use character formatting using HTML tags for all textoccs (in fact: for all text attributes!):
var sHTMLValue = [textocc].TextDef().Attribute(Constants.AT_NAME,Context.getSelectedLanguage() ).getStyledValue().getHTML()
now use HTML tag <b>...</b> in this string to format all (or some) characters as bold and write it back using
[textocc].TextDef().Attribute(Constants.AT_NAME,Context.getSelectedLanguage() ).setStyledValue(sHTMLValue)
If you want to apply character formatting to placed model attribute texts, you will have to format the placed model attribute this way and not the textocc itself, because it is just a "link" to the attribute value. But stylesheets are supported for both "kinds" of textoccs.
BR, Torsten
Hi Torsten Haase,
Thanks for your reply below are full Code.
<p>Level C:</p><br/><ul><br/> <li> Level C Name </li><br/> After all Level C was printed print associated Fas </ul><br/><p>FA:</p><br/>This is the Full code...
I have print such attribute in html tag.....
Please Suggest me ..How I can Print this type of above script.
Thanks
vivek ingle
Hi Vivek Ingle,
sorry but I don't quite understand your question:
- do you want to write this HTML formatting to an attribute?
- is this the content of an attribute and you want it to be written to the output object?
Please have a look at your HTML string: the <ul> tag is not closed so this will maybe not return proper results.
BR,
Torsten
Hi Roman,
you can either also use HTML-formatted attributes here (get attribute AT_NAME and use AttrTextDef.setStyledValue() ) or format the AttrOcc:
A TextOcc has only one attribute: AT_NAME. You can get the corresponding AttrOcc by calling TextOcc.AttrOcc(Constants.AT_NAME). Using this, you can set the alignment of the TextOcc and apply a FontStyleSheet.
BR, Torsten