It's all about the answers!

Ask a question

How to use 'isHeading' property in RPE with DNG module


Ravi Gollapudi (37121) | asked Mar 19 '20, 12:53 p.m.

It's an emergency for me: Any help is appreciated. 

Please read this as steps I am trying to implement.

DNG module (contextBinding) 
     > If the first artifact Heading 1, print "heading section & Title" in heading 1 style 
     > if the second artifact is Heading 1.1, print "heading section & Title" in heading 2 style
     >  if the third artifact is not Heading, print Identifier \n Contents \n

I am playing with 'IsHeading' property, but not getting the result.

Accepted answer


permanent link
Pierre Bentkowski (131517) | answered Mar 19 '20, 1:49 p.m.
Hi

From the module data source, query the contextBinding

In that query container, put 2 containers, one with isHeading == "true" condition and one with isHeading == "false" condition.

In the container with isHeading == "true"
    Add a paragraph to print the "Title" and set the style using contextBinding/depth

In the container with isHeading == "false"
    Define a text dynamic data source using the contextBinding/about information
    and extract the text to be printed.

Hope it helps.


Ravi Gollapudi selected this answer as the correct answer

Comments
Ravi Gollapudi commented Mar 19 '20, 2:07 p.m.
Thanks for your quick replies, Pierre !

It did help. I could separate heading artifacts and text artifacts.

Do I have to use a javascript to set contextBinding/depth ?

One other answer



permanent link
Pierre Bentkowski (131517) | answered Mar 19 '20, 1:22 p.m.
Hello

I am guessing some issue base on the info you provided.

The isHeading is a string "true" or "false", the test is not on a Boolean:
       isHeading == "true"

For the style, instead you can use the "depth".
If you set the style to the depth as is , RPE will understand that: 1 is header 1, 2 is header 2, etc

The heading number, you can use the "section"
I usually do not use that data.
I really on the word style to handle it.
Just make sure the word style display the heading number.


Pierre


Comments
Ravi Gollapudi commented Mar 19 '20, 1:30 p.m.
Hi Pierre,

I want to check the first artifact in the module is a heading. If it is, then I have to print only Section # and Title, and loop this until I see a non-heading artifact. When I see a non-heading artifact, I want to print its Identifier and Contents.

I hope I am clear now.

Thanks.

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.