Community Tip - You can change your system assigned username to something more personal in your community settings. X
Hello everyone,
I am currently working on a process which publish an xml to PDF. I use APP. I would like to have a table which borders are gray and header row is with gray background. Like in this figure:
The the header shading, I follow the instruction from topic: "How to colour table header in PDF". It works well. Thanks for Joachim Groos!
However, when I do the same for table cell border, it goes into problem. Here are what I do:
1. I create a Property set "table-cell-frame" which create a rule, and then I add that rule into current table cell. Like this:
2. I added that property to context "entry anywhere in thead"
The output, in fact, is working as desired. However, there are errors in event log. The errors are:
"Pg 4 JavaScript: Error: Error: fRules.addRule: Invalid object addRule([object fRule])@:0 onEnter([object Object],[object Object])@stylesheet0:PropertySet:table-cell-frame:onEnter:24
onEnter([object fStreamPos])@stylesheet0:Element:entry:theadentry7936:onEnter:23 runMacro("sprint \"_app:spFormatWithIndex\"",true)@:0 @_app:FormatWithIndex:3
. [1500] (2:"stylesheet0:Element:entry:theadentry7936:onEnter"#93) (1:"editorDom0"#{0;/RDStyle/ResolvedMap/techinfomap/division[1]/concept/conbody/table/tgroup/thead/row/entry[1]/p}) "
I guess those javascript errors are because addRule() is called from a wrong context. But why the results show the correct layout?
I have checked in the help for anywhere using addRule(), unfortunately, there is no example for calling that function from a cell. Changing the border manually using "Modify Borders" dialog is not an option.
Does anyone has experience with this? Thanks in advance for any idea how this behave like this and what can I do to resolve!
With best regards,
Thao Nguyen
Hi Thao
If you are happy with the output but just want to trace the error, then the best way to do this (assuming you are using the latest Abrx v7) is to print preview and save out the native APP 3d file, open this in APP desktop (v11.1 preferably same version as embedded into your Arbx version) and trace it through the debugger.
If that is an option for you i hope it helps
Regards
Chris Western
Thank Chris! Even though the table layout is correct, I was not happy with all the errors in EventLog, it doesn't look nice.
Finally, one of my colleague found out what is wrong:
- It seems a rule created by new fRule doesn't create an object that the formatting want to be using
- addRule() documentation shows that the function can be used to return an object as well, so a rule object is created by addRule()
- No need to add it again later
So the solution is:
And no error appears. 🙂