Using the Path Query method NewLine, one can include a new line at the end of a string. Any subsequent string would be added to the new line. This article provides some examples of how NewLine can be used.


Join(NewLine)

This returns a list of objects, separated by new line.


'String' + NewLine + 'String'

This returns the two strings separated by a new line.

 


Name + NewLine + Version

Likewise, you can use it with, e.g., Name and Version

<Report>
<Text>#{? Name + NewLine + Version} </Text>
</Report>

A more complete example for a Graph can be found here.


With Variable

There is also support for this in Variable. 


<Report>
  <FontStyles>
    <FontStyle name="font1" font="Consolas" size="10" color="red"/>
    <FontStyle name="font2" font="Consolas" size="10" color="black"/>
  </FontStyles>
  <Variable name="Contract" as="[String]" select="@CONTR.Split(NewLine)"/>
  <Variable name="ReferencedItems" as="[Item]" select="getAllReferencedItems(.,.)"/>
  <Variable name="ReferencedParts" as="[Part]" select="getAllReferencedItems(.,.)/part::*"/>
  <Variable name="ReferencedItemTypes" as="[Object]" select="getAllReferencedItems(.,.).Select(Type).Distinct"/>
  <Variable name="ReferencedPartTypes" as="[Object]" select="getAllReferencedItems(.,.)/part::*.Select(Type).Distinct"/>
  <Function name="getAllReferencedItems" as="Items">
    <Parameter name="p1" as="Items"/>
    <Parameter name="PreviousItems" as="Items"/>
    <Variable name="NextItems" as="Items" select="($p1/part::*/defobj:: union $p1/part::*/refobj::)[not . in $PreviousItems]"/>
    <Variable name="Accumulated" as="Items" select="$PreviousItems union $NextItems"/>
    <Value select="if $NextItems then getAllReferencedItems($NextItems, $Accumulated) else $Accumulated"/>
  </Function>
  <Section title="Items Not Included in the Contract ">
    <ForEach select="$ReferencedItemTypes">
      <Variable name="currentItem" as="String" select="'&lt;ItemType sid=&quot;' + SID + '&quot;/&gt;'"/>
  
        <If test="not $currentItem in  $Contract">
          <Text font="font1">   #{? $currentItem }</Text>
        </If>
        </ForEach>  
     </Section>
     <Section title="Parts Not Included in the Contract ">

        <ForEach select="$ReferencedPartTypes">
            <Variable name="currentPartSID" as="String" select="SID"/>
            <Variable name="owner" as="String" select="$ReferencedParts[SID = $currentPartSID ].Select(Owner.SID).Distinct.Join(',') "/>
            <Variable name="defobj" as="String" select="$ReferencedParts[SID = $currentPartSID ].Select(DefObj.SID).Distinct.Join(',')"/>
            <Variable name="refobj" as="String" select="$ReferencedParts[SID = $currentPartSID ].Select(RefObj.SID).Distinct.Join(',')"/>
            <Variable name="currentPart" as="String" select="'&lt;PartType sid=&quot;' + SID + '&quot;' + ' ownerType=&quot;' + $owner + '&quot;' + ' defType=&quot;' + $defobj + '&quot;' + (if $refobj != '' then (' refType=&quot;' + $refobj + '&quot;' ) else '') + '/&gt;' "/>
            <If test="not $currentPart in  $Contract">
                <Text font="font1">   #{? $currentPart }</Text>
            </If>
        </ForEach>
    </Section>
</Report>