Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

#RPE-DNG_ Remove hyperlink from the DNG exported data

 I am using RPE V2.1.2 and DNG v 6.0.6.1. I am exporting DNG module data using RPE.  In DNG,  embedded artifacts are linked to the content(description), which is getting exported in  hyperlink form when I export the requirement details using query datasource/artifact/content/text/richTextbody/div and DNG text schema. I want the DNG export without hyperlink. my requirement is to remove hyperlink from the content when it is exported and apply some formatting(highlight embedded artifact). 

I have gone though some online documentation(https://rpeactual.com/2013/01/18/processing-rich-text-in-rpe/) but it is not helping. 
Please suggest me how can I achieve this?
Thanks!

0 votes


Accepted answer

Permanent link

You can add a bookmark for every artifact that is linked to the content. You can either use a post processing macro or java script to change external hyperlinks into internal hyperlinks to the bookmarks.

Sub processHyperlinks()
'Processes external hyperlinks to RRC and turns them into internal Word hyperlinks to bookmarks with the
'address I<requirement artifact item id>

Dim oHyperLink As Hyperlink

For Each oHyperLink In ActiveDocument.Hyperlinks
'   MsgBox ("Subaddress=" & ActiveDocument.Hyperlinks(counter).SubAddress & "Address=" & ActiveDocument.Hyperlinks(counter).address & "Name=" & ActiveDocument.Hyperlinks(counter).name & "TextToDisplay=" & ActiveDocument.Hyperlinks(counter).TextToDisplay)
  oHyperLink.Range.Select
 
  Dim address As String
  address = oHyperLink.address
 
  Dim index As Integer
  index = InStr(address, "/resources/")
 
  If index > 0 And address <> oHyperLink.TextToDisplay Then
     Dim name As String
     name = "I" + Right(address, Len(address) - index - 10)
    
     Dim display As String
     display = oHyperLink.TextToDisplay
    
     If display <> "" Then ActiveDocument.Hyperlinks.Add Anchor:=oHyperLink.Range, SubAddress:=name, TextToDisplay:=display
  End If

Next oHyperLink

End Sub

You can also get this with simple java script substring and replace functions.

Anjuri Kelaiya selected this answer as the correct answer

0 votes

Comments

Hello Subramanya


I added macro as mentioned above and it is working as expected.
Many thanks for your help.
 

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,025

Question asked: Oct 30 '19, 1:52 a.m.

Question was seen: 1,086 times

Last updated: Nov 01 '19, 3:08 a.m.

Confirmation Cancel Confirm