Hello. I am experiencing serious trouble creating a proper table of contents (toc) in my ARIS reports. I use the scripting editor for doing this. The input is a set of EPC models, and the output is a set of Word or PDF documents (one for each model).
The script uses three sections. The second section writes the TOC page
// the variable out holds the ArisOutput object out.BeginSection(false, Constants.SECTION_COVER); // coverpage goes here... out.EndSection(); out.BeginSection(false, Constants.SECTION_INDEX); // TOC code goes here: out.BeginTable(100, Constants.C_DARK_GREEN, Constants.C_TRANSPARENT, Constants.FMT_CENTER | Constants.FMT_VCENTER, 0); out.TableRow(); out.SetFrameStyle(Constants.FRAME_TOP, 30); out.SetFrameStyle(Constants.FRAME_LEFT, 30); out.SetFrameStyle(Constants.FRAME_RIGHT, 30); out.SetFrameStyle(Constants.FRAME_BOTTOM, 30); out.TableCellF("TABLE OF CONTENTS", 100, Layouts.CONTENTS_PAGE_TITLE); out.EndTable("", 100, "Arial", 10, Constants.C_DARK_GREEN, Constants.C_TRANSPARENT, 0, Constants.FMT_CENTER | Constants.FMT_VCENTER, 0); out.OutputLnF("", Layouts.NORMAL); out.SetAutoTOCNumbering(true); out.OutputField(Constants.FIELD_TOC, "Arial", 10, Constants.C_BLACK, Constants.C_WHITE, Constants.FMT_LEFT); out.EndSection(); // Finally, we draw the contents: out.BeginSection(false, Constants.SECTION_DEFAULT); // ... out.EndSection();
As far as I can see, this is done correctly. The toc is output to the document, but the page numbers are not updated! So for each heading in the toc, the page no. is the same all the way down. Very frustrating!
Any ideas on how to solve this problem? I am using ARIS IT Architect 7.1.0.423484
Problem with Auto Table of Content for Word document
Hello all, we are experiencing problem with generating Automatic Table of Content for MS Word document using ARIS methods.
VEA Script for Auto-TOC generation:
Following is the code snippet that we are using to generate the Auto-TOC.
- To create Auto TOC:
- To create a Style Sheet for TOC entry:
- To apply the defined style sheet to the output line:
- The hyperlinks in the TOC takes you to the destined page, however, the page numbering in the TOC is incorrect, it is as follows:
- There is one more strange side of this TOC problem, the page numbering changes as we change the page format. The output snapshot shown above is for Letter Size page format. While the snapshot shown below is for A5 size:
ARIS Standard Script for Auto-TOC:
- I would like to bring to your notice that even the ARIS Standard reports have this problem. I tried the report ‘Output model information’ and that report also has this problem. The output snapshot is as shown below:
TOC with Script designer (WYSIWYG):
- I also tried the Script designer tool of ARIS (i.e. WYSIWYG), shown below is the script design that we created using script designer.
- As we can see we have included the Table of Content field in the script. The output is as follows:
NOTE: This issue is only with Word(.DOC) and Rich Text File(.RTF) document, for PDF page numbering is perfect.
Rahul has given the answer in part: "...the page numbering changes as we change the page format. "
To me it seems that Word is the culprit, as the generated TOC is a field that needs an event to trigger an update of page numbering, like highlighting it and pressing [F9] or changing the printing page size.
Maybe in Aris VisualBasic script you can manipulate the DOC afterwards and execute something like
Range.Fields.Update
recursively on all sections, but in Aris javascript ?
Regards, Martin