Skip to Content
0
Former Member
Dec 09, 2010 at 07:28 AM

Table of contents in Crsytal Reports 2008

72 Views

Hi,

I have a requirement to create table of contents showing pagenumbers along with the titles in report.I tried using below formula:

WhilePrintingRecords;

StringVar Array catArry;

NumberVar Array pageArry;

IF NOT (GroupName({ARTIST.LAST_NM}) IN catArry) THEN (

Redim Preserve pageArry[UBound(pageArry) + 1];

pageArry[UBound(pageArry)] := PageNumber;

Redim Preserve catArry[UBound(catArry) + 1];

catArry[UBound(catArry)] := GroupName({ARTIST.LAST_NM});

);

"";

Here grouping should be done on the name of last name. I have created a group also with that. This formula is added in Report header. But i am getting an error stating "A boolean value is required here" while saving it.

I also tried the below formula as an alternative approach:

global stringvar strTOC1;

global stringvar strTOC2;

local stringvar strTemp;

if not InRepeatedGroupHeader then

( strTemp := {ARTIST.LAST_NM} + chr(10) ;

if len(strTemp) + len(strToc1) <= 254 then

( strToc1 := StrToc1 + strTemp;

strToc2 := StrToc2 +

totext(PageNumber,0) + chr(10) ))

This also gives the same error.

Please let me know if the formulas used are incorrect. Please suggest if there are anyother ways to implement this.

Thanks in advance!