AR

Hello everyone,

 

I am facing a problem in creating a TOC(table of content) in word document which is created by script.

my word document have many sections(means pages). each page have one heading with few details of model or object.

I want to create index/Summary/TOC for this report with page number.

 

My current scenario is like this:



//for cover page

output.BeginSection(true,Constants.SECTION_COVER);

//some code here

output.EndSection();





for(int i=0;i<100;i++)

{

output.BeginSection(true,Constants.SECTION_DEFAULT);

//some code

output.EndSection();



   for()

   {

     output.BeginSection(true,Constants.SECTION_DEFAULT);

    //some code

    output.EndSection();

   }

}



So please suggest where and how we can create TOC(table of content).

I tried with below code in  "Index section" but didn't got succeeded.

output.BeginSection(200, 200, 10, 10, 30, 30, 30, 30, false, Constants.SECTION_INDEX);
output.SetAutoTOCNumbering(true);
    //Defines the style for the four levels in the TOC 
    output.SetTOCFormat(0, "Arial", 20, Constants.C_BLACK, Constants.C_WHITE, Constants.FMT_LEFT | Constants.FMT_BOLD | Constants.FMT_ITALIC, 0, 0, 0, 0);

    output.SetTOCFormat(1, "Arial", 16, Constants.C_GREEN, Constants.C_WHITE, Constants.FMT_LEFT | Constants.FMT_BOLD, 5, 5, 2, 2);

    output.SetTOCFormat(2, "Arial", 12, Constants.C_RED, Constants.C_WHITE, Constants.FMT_LEFT | Constants.FMT_ITALIC, 10 , 5, 2, 2); 

    output.SetTOCFormat(3, "Arial", 10, Constants.C_BLUE, Constants.C_WHITE, Constants.FMT_LEFT, 15, 5, 2, 2);

    //Output text 
    output.OutputLn("Table_of_Contents", "Arial", 30, Constants.C_BLACK, Constants.C_WHITE, Constants.FMT_LEFT, 0); 

    //Adds the table of content 
    output.OutputField(Constants.FIELD_TOC, "Arial", 10, Constants.C_BLACK,
Constants.C_WHITE, Constants.FMT_LEFT); 
    output.EndSection();


 

please help and let me know if further details are required.



Thanks,

Ankit





 

 

 

 

Featured achievement

Rookie
Say hello to the ARIS Community! Personalize your community experience by following forums or tags, liking a post or uploading a profile picture.
Recent Unlocks

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock