Customize the export RTF/Word
Hi all,
Newbie to DOORs and to this forum.
I found a rtfexport,dxl on this forum which Im trying to modify to get the export in specific format. Below are the output that I am want:
1.0 Functional Requirements
1.1 Sub header 1
1.1.1 Sub header 2
Req_1: Req Name 1
Example Req Text.
Rationale : Example Rationale .
Req_ID: Req Name 2
Example Req Text.
Rationale Example Rationale.
Below is the output that Im getting :
3 Functional Requirements
3.1 Sub header 1
3.1.1 Subheader 2
Req_1: Req Name 1
Example Req Text
Rationale : Example Rationale
Req_2: Req Name 2
Example Req text .
Rationale : Example Rationale
There is some additional space after every major heading. I modified the rtfdumpObject block code to this :
// Check if text_string (body text) exists for the current object 'o' // text_string was fetched around line 418 using getBodyText(o, false) if ((!null text_string) && (!hasPicture o)) { // Now check the type of the current object 'o' string currentObjType = o."Object Type" "" if (currentObjType == "Requirement") { // --- REQUIREMENT OBJECT OUTPUT --- // This object 'o' IS the requirement itself. // 1. Output ReqID & Name Line string reqID = ""; int objAbsNum = o."Absolute Number" // Uses GLOBAL 'prefix' (Ensure defined globally and assigned in initRTFData) // NO Underscore added if (!null prefix && prefix != "" && objAbsNum > 0) { reqID = prefix "" objAbsNum "" } string shortTxt = o."Object Short Text" "" if (reqID != "" || shortTxt != "") { // Force New Paragraph (\pard), Arial 11pt Bold, Space Before(\sb200) and AFTER(\sa100) cout << "{\pard\plain\f0\fs22\b\sb200\sa100 " // Explicit \pard, Space Before & AFTER if (reqID != "") { cout << reqID << ": " } cout << shortTxt cout << "\b0\par}" // End Bold, End Para cout << (NLS("\n")) } // 2. Output Main Requirement Text (using text_string) // Force New Paragraph, Arial 11pt, Space AFTER cout << "{\pard\plain\f0\fs22\sa100 " // Explicit \pard, Arial 11pt, Space After cout << text_string // Main text (includes OLEs) cout << "\par}" // End Para cout << (NLS_("\n")) // 3. Output Rationale Line if (exists attribute "Rationale") { string rationaleContent = richText(o."_Rationale") // NO OLEs if (rationaleContent != "") { // Force New Paragraph, Arial 11pt for label AND content, Space BEFORE(\sb100) and AFTER(\sa100) cout << "{\pard\plain\f0\fs22\sb100\sa100 " // Explicit \pard, Arial 11pt, Space Before & After cout << "{\i Rationale : } " // Italic label is Arial 11pt // Force Arial 11pt (\f0\fs22) on the content string itself cout << "{\f0\fs22 " << rationaleContent << "}" cout << "\par}" // End Para cout << (NLS("\n")) } } // 4. Horizontal Line REMOVED } else { // --- NON-REQUIREMENT OBJECT OUTPUT --- // The heading (if any) was printed BEFORE this block. Print only body text. cout << paraBreak // Use standard paragraph break (includes \pard) cout << styleSelect[0] // Use default style (Arial 11pt from Mod 1) cout << "\sa100 " // Standard space after cout << text_string // The body text ('text_string') cout << (NLS_("\n")) } } // End of the replacement for the original 'if ((!null text_string) ...)' else if ((null heading) && (null text_string)) // Keep original handling for completely empty objects { // This part handles objects that have NO heading AND NO text_string if ((!hasPicture o) && (!oleIsObject o) && includeNumbers) { / totally empty object, dump heading number as per display / cout << paraBreak cout << styleSelect[actual] // Use correct level style (now Arial 12 Bold) cout << (number o (NLS_(" "))) cout << "\par" << (NLS_("\n")) // Ensure paragraph end } } if ((null heading) && (null text_string)) { if ((!hasPicture o) && (!oleIsObject o) && includeNumbers) { / totally empty object, dump heading number as per display / cout << paraBreak cout << styleSelect[actual] cout << (number o (NLS_(" "))) } else { cout << paraBreak cout << styleSelect[0] cout << (NLS_("\n")) } } return actual }
Im not able to remove that Paragraph space and change the rationale text size to Arial 11 after forcing it to do so .
Is there any exporttoword.dxl available, as mine is encrypted. Main aim is to have a word document in specific format
Thanks,
Bhargav