Put the following code inside the formula. Remamber to change the "viewEmployeeList.Dept_Name" to your required database field. Offcourse it will be a group name.
global stringvar strTOC1;
global stringvar strTOC2;
local stringvar strTemp;
if not InRepeatedGroupHeader then
( strTemp := {viewEmployeeList.Dept_Name} + chr(10) ;
if len(strTemp) + len(strToc1) <= 254 then
( strToc1 := StrToc1 + strTemp;
strToc2 := StrToc2 +
totext(PageNumber,0) + chr(10) ))
Step:2
Place the Formula Field Named "collect_TOC" in your Group Header Section and supress the Formula field.
Step :3
Create a Formula Field Named "s_TOC" and place the following code
whileprintingrecords;
global stringvar strTOC1;
strToc1
Step :4
Create a Formula Field Named "n_TOC" and place the following code
whileprintingrecords;
global stringvar strTOC2;
strToc2
Step :5
Place both "n_TOC" & "s_TOC" the formula fiel side by side at the page Footer Section.
Rune the report you got the TOC
Limitation:
1. The Table of Contants will be display at the bottom of your report
2. Its for a Small Table of Contants up to 256 char