It's all about the answers!

Ask a question

Print By RPE The Tables Authored Among Text In DNG Artifact


Massimo Maschio (132) | asked Jan 30 '23, 5:17 a.m.

 I would like to understand how to identify and print properly through RPE the tables I have in DOORS Next Artifacts.


My case is the following:
I have in DOORS Next some artifacts authored in a module.
Some of those artifacts contain a table among the text, like:
ID              |   Summary
ArtifactID   |   <Standard Text>
                  |   <Table>
                  |   <Standard Text>

So, basically, within a single artifact I have both "standard text" and other text inside a table.
My simple question is: there is a way in RPE to identify that some text in a DNG Artifact is manage within a table?
This because I would like to display it differently (other formats, colors, whatever) by RPE.

Thanks in advance for any answers / suggenstions.

Accepted answer


permanent link
Karan Dethalia (561) | answered Feb 03 '23, 7:32 a.m.

You can try formatting it using javascript, here is an example where ETM rich text is rendered using XHTML - https://rpeactual.wordpress.com/2018/05/07/render-test-script-step-description-rich-text-xhtml-with-execution-variables/


Massimo Maschio selected this answer as the correct answer

Comments
Massimo Maschio commented May 18 '23, 8:37 a.m. | edited May 18 '23, 8:39 a.m.

Hi Karan, Thank you very much for your kind answer. After some additional exploration I found out the solution that works properly for me: I use the following JavaScript:


var textToPrint = div;
textToPrint = textToPrint.replace(/(font-size.?pt)/gi, "");
textToPrint = textToPrint.replace(/(<span style="font-family.?">)/gi, "<span>");
textToPrint = textToPrint.replace(/( font-family.*?">)/gi, "\">");
textToPrint;

The extracted and used "div" is the one you can find in the query "dataSource/artifact/content/text/richTextBody/div". XHTML Input and XHTML Output are both checked and selected in the Script Expression window.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.