Start a new topic
Answered

Style of Table Of Contents

Is there any way to change the style of TableOfContents in a report?


Best Answer

The Table Of Content uses predefined font styles and paragraph styles named accordingly:

FontStyleTOC1, FontStyleTOC2, ...  
ParaStyleTOC1, ParaStyleTOC2, ...

These styles can be modified, using the <ParaStyles> and <FontStyles>

Example for a Default style of TableOfContents :


<Report>
  <TableOfContents/>
  <Section title="Introduction">
  </Section>
  <Section title="Chapter 1">
    <Section title="This is a section">
    </Section>
    <Section title="This is another section">
      <Section title="This is third level section">
      </Section>
    </Section>
  </Section>
</Report>

 Result:

image


Example for a Modified style of TableOfContents :

 

<Report>
 <ParaStyles>
    <ParaStyle name="TOC1" alignment="left" spaceBefore="0"/>
    <ParaStyle name="TOC2" alignment="left" spaceBefore="0"/> 
 </ParaStyles>
 <FontStyles>
    <FontStyle name="TOC1" style="bold" font="Times New Roman" size="24" color="Aqua" />
    <FontStyle name="TOC2" style="bold" font="Times New Roman" size="20" color="Aqua" />
 </FontStyles>
  <TableOfContents/>
  <Section title="Introduction">
  </Section>
  <Section title="Chapter 1">
    <Section title="This is a section">
    </Section>
    <Section title="This is another section">
      <Section title="This is third level section">
      </Section>
    </Section>
  </Section>
</Report>

 Result:

image




1 person has this question
1 Comment

Answer

The Table Of Content uses predefined font styles and paragraph styles named accordingly:

FontStyleTOC1, FontStyleTOC2, ...  
ParaStyleTOC1, ParaStyleTOC2, ...

These styles can be modified, using the <ParaStyles> and <FontStyles>

Example for a Default style of TableOfContents :


<Report>
  <TableOfContents/>
  <Section title="Introduction">
  </Section>
  <Section title="Chapter 1">
    <Section title="This is a section">
    </Section>
    <Section title="This is another section">
      <Section title="This is third level section">
      </Section>
    </Section>
  </Section>
</Report>

 Result:

image


Example for a Modified style of TableOfContents :

 

<Report>
 <ParaStyles>
    <ParaStyle name="TOC1" alignment="left" spaceBefore="0"/>
    <ParaStyle name="TOC2" alignment="left" spaceBefore="0"/> 
 </ParaStyles>
 <FontStyles>
    <FontStyle name="TOC1" style="bold" font="Times New Roman" size="24" color="Aqua" />
    <FontStyle name="TOC2" style="bold" font="Times New Roman" size="20" color="Aqua" />
 </FontStyles>
  <TableOfContents/>
  <Section title="Introduction">
  </Section>
  <Section title="Chapter 1">
    <Section title="This is a section">
    </Section>
    <Section title="This is another section">
      <Section title="This is third level section">
      </Section>
    </Section>
  </Section>
</Report>

 Result:

image



Login to post a comment