Hi,
I am trying to have formatted text output using the "OutputFormattedText" function to be justified in the Word document. I do not see text alignment when changing the attribute.
I tried adding a formatted paragraph, but it gives an error when trying to output the formatted text:
"Error while executing script:
Script: formatting, line 14
OutputFormattedText: You cannot use an OutputFormattedText method within a paragraph or list."
I also tried manipulating the HTML format, but it ignores any justification settings.
Any ideas would be appreciated.
Thank you,
Francois
Hi,
My main goal is to output in a report the styled text value of an attribute (most importantly numbering/bulleting) in a different font, font size, and font color from what the attribute originally exists in the database, example:
Attribute as it exists in the database:
Attribute as it should be outputted in the report:
The only solution I could find was to:
- Add a font format in the database with the desired settings
- Retrieve the attribute using getHTMLFormattedValue()
- Merge the retrieved attribute with the font format added to the database using getMergedFormatting
- Outputing the result with getHTML using OutputFormattedText
The code is something like the below:
var nLocale = Context.getSelectedLanguage() var p_aModel = ArisData.getSelectedModels() var p_StyledValue = p_aModel[0].Attribute(Constants.AT_NAME, nLocale).getHTMLFormattedValue()) var FontList = ArisData.getActiveDatabase().FontStyleList() p_StyledValue = p_StyledValue.getMergedFormatting(FontList[0].Font(nLocale) ) p_output.OutputFormattedText( p_StyledValue.getHTML() )
Everything worked perfectly except for one hiccup: the final result magically had an indentation before the output by 6mm, example:
Edit: After more research, the issue is with bulleting an attribute itself, where it inserts the indent by default, hence I don't think there is a way to manipulate this indentation