Tags:
not added yet
This Wiki page describes outdated Word Export customization, which has been completely reworked in CodeBeamer 7.2. For customization of Word templates look at
![]() Customizing Word Export of IssuesTable of ContentsFormat of the exported fileThe file that is actually exported for Word is not a native Word document, but an MHTML It consists of multiple so-called parts:
Customizing the content: HTML and CSSThe content of the document body, the document header and the document footer are rendered from regular Velocity templates It's important to understand that what you actually do is modifying an HTML template. You can use most of the HTML formatting capabilities (like colors, font weight, and borders), most of the HTML text constructs (like lists or tables), but not everything. For instance, floating <div>'s will not be understood by Word, as a floating block doesn't make much sense in a word processor. You can also use CSS, with the same restrictions: exotic visualization, like drop shadows, will be ignored by Word. The template files are located in the CB_HOME//tomcat/webapps/cb/config/templates/html directory:
Modify them, save them and export a new document. codeBeamer will pick up your changes immediately. Word-specific fieldsAnother interesting feature is that you can use special, non-standard HTML fragments in the templates, which generate fields managed by Word. You can, for instance, add this snippet to have an intelligent Word-managed TOC in your document: <p class=MsoToc1> <!--[if supportFields]> <span style='mso-element:field-begin'></span> TOC \o "1-3" \u <span style='mso-element:field-separator'></span> <![endif]--> <span style='mso-no-proof:yes'>Please right-click and choose "Update Field" to initialize this field.</span> <!--[if supportFields]> <span style='mso-element:field-end'></span> <![endif]--> </p> Or, you can insert this to have a "17 of 82" style page number (fully managed and recomputed by Word!): Page <!--[if supportFields]> <span class=MsoPageNumber><span style='mso-element:field-begin'></span> PAGE <span style='mso-element:field-separator'></span></span> <![endif]--> <span class=MsoPageNumber><span style='mso-no-proof:yes'>1</span></span> <!--[if supportFields]> <span class=MsoPageNumber><span style='mso-element:field-end'></span></span> <![endif]--> of <!--[if supportFields]> <span class=MsoPageNumber><span style='mso-element:field-begin'></span> NUMPAGES <span style='mso-element:field-separator'></span></span> <![endif]--> <span class=MsoPageNumber><span style='mso-no-proof:yes'>1</span></span> <!--[if supportFields]> <span class=MsoPageNumber><span style='mso-element:field-end'></span></span> <![endif]--> ExamplesModifying the page header and adding your company logoModify the "h1" paragraph in requirement-document-export-headerfooter.vm and add a new <img> element where it fits. Adding further attributes to requirementsModify this table in requirement-document-export-body.vm and add the fields you want to see in the exported document: <table class="requirement-props"> <tr><td class="field">Revision:</td><td class="value">3</td></tr> <tr><td class="field">Priority:</td><td class="value">${requirement.namedPriority.name}</td></tr> #if(${requirement.status})<tr><td class="field">Status:</td><td class="value">${requirement.status.name}</td></tr>#end </table> List of Objects/Entities available in the export contextThis table lists the objects available in the velocity script above:
About figuring out what properties are available on of these CodeBeamer objects: please look at the remote-api documentation and the javadoc found in. As you may already know CodeBeamer provides a rich API for querying and manipulating CodeBeamer objects programmatically using an RPC protocol. This API is documented here: You must login to see this link. Register now, if you have no user account yet. So the remote-api contains the Javadoc of most internal CodeBeamer objects I've listed above, and is shipped with the CodeBeamer distribution. You can find it below your CodeBeamer installation directory on a path like: $CB_HOME/tomcat/webapps/cb/codebeamer-api-6.0.0.zip. If you unzip this zip file somewhere then you will see a "docs/api/" directory where the generated Javadoc resides. Open the index.html here and you will find the Javadoc and properties of the objects (like our TrackerItemDto). Be warned however that the signature of these objects, the export scripts may and practically will change between any new CodeBeamer releases in the future. I would strongly recommend that you try to keep your customizations as isolated as possible, and using a git repository for tracking such changes is recommended. This will make your life much easier if you plan to upgrade CodeBeamer in the future... |
Fast Links
codeBeamer Overview codeBeamer Knowledge Base Services by Intland Software |
This website stores cookies on your computer. These cookies are used to improve your browsing experience, constantly optimize the functionality and content of our website, furthermore helps us to understand your interests and provide more personalized services to you, both on this website and through other media. With your permission we and our partners may use precise geolocation data and identification through device scanning. You may click accept to consent to our and our partners’ processing as described above. Please be aware that some processing of your personal data may not require your consent, but you have a right to object to such processing. By using our website, you acknowledge this notice of our cookie practices. By accepting and continuing to browse this site, you agree to this use. For more information about the cookies we use, please visit our Privacy Policy.Your preferences will apply to this website only.