I am new to this in depth of crystal reports. I inherited this report I am not the original author.
Here is the formula I am using
//shared stringvar GSval := GSval & Sum ({@grossSales}, {SalesClass.RecDate}, "quarterly") & "^"
Local numbervar x := 1;
Local numbervar y := 0;
Local stringvar tempStr := "";
shared stringvar showval;
whileprintingrecords;
//shared stringvar showval := showval + totext({@diffPercent}) + "^";
Select (GroupName ({SalesClass.RecDate}, "quarterly"))
Case "1/" & toText(Year(Currentdate)-3,0,""):
y := 1
Case "4/" & toText(Year(Currentdate)-3,0,""):
y := 2
Case "7/" & toText(Year(Currentdate)-3,0,""):
y := 3
Case "10/" & toText(Year(Currentdate)-3,0,""):
y := 4
Case "1/" & toText(Year(Currentdate)-2,0,""):
y := 5
Case "4/" & toText(Year(Currentdate)-2,0,""):
y := 6
Case "7/" & toText(Year(Currentdate)-2,0,""):
y := 7
Case "10/" & toText(Year(Currentdate)-2,0,""):
y := 8
Case "1/" & toText(Year(Currentdate)-1,0,""):
y := 9
Case "4/" & toText(Year(Currentdate)-1,0,""):
y := 10
Case "7/" & toText(Year(Currentdate)-1,0,""):
y := 11
Case "10/" & toText(Year(Currentdate)-1,0,""):
y := 12
Case "1/" & toText(Year(Currentdate),0,""):
y := 13
Case "4/" & toText(Year(Currentdate),0,""):
y := 14
Case "7/" & toText(Year(Currentdate),0,""):
y := 15
Case "10/" & toText(Year(Currentdate),0,""):
y := 16;
for x := 1 to 16 Do(
Local stringvar z := "";
z := split(showval,"^")[x];
if x = y then
tempStr := tempStr + totext((Sum ({SalesClass.SalePrc}, {SalesClass.RecDate}, "quarterly")+Sum ({SalesClass.DiscAmnt}, {SalesClass.RecDate}, "quarterly")),0,"") + "^"
else
tempStr := tempStr + z + "^"
);
shared stringvar showval := Left(tempStr, Len(tempStr)-1)
The error is happing in this section I believe
z := split(showval,"^")[x];
Any suggestion on how to fix this error is appreciated.
Here is the formula I am using
//shared stringvar GSval := GSval & Sum ({@grossSales}, {SalesClass.RecDate}, "quarterly") & "^"
Local numbervar x := 1;
Local numbervar y := 0;
Local stringvar tempStr := "";
shared stringvar showval;
whileprintingrecords;
//shared stringvar showval := showval + totext({@diffPercent}) + "^";
Select (GroupName ({SalesClass.RecDate}, "quarterly"))
Case "1/" & toText(Year(Currentdate)-3,0,""):
y := 1
Case "4/" & toText(Year(Currentdate)-3,0,""):
y := 2
Case "7/" & toText(Year(Currentdate)-3,0,""):
y := 3
Case "10/" & toText(Year(Currentdate)-3,0,""):
y := 4
Case "1/" & toText(Year(Currentdate)-2,0,""):
y := 5
Case "4/" & toText(Year(Currentdate)-2,0,""):
y := 6
Case "7/" & toText(Year(Currentdate)-2,0,""):
y := 7
Case "10/" & toText(Year(Currentdate)-2,0,""):
y := 8
Case "1/" & toText(Year(Currentdate)-1,0,""):
y := 9
Case "4/" & toText(Year(Currentdate)-1,0,""):
y := 10
Case "7/" & toText(Year(Currentdate)-1,0,""):
y := 11
Case "10/" & toText(Year(Currentdate)-1,0,""):
y := 12
Case "1/" & toText(Year(Currentdate),0,""):
y := 13
Case "4/" & toText(Year(Currentdate),0,""):
y := 14
Case "7/" & toText(Year(Currentdate),0,""):
y := 15
Case "10/" & toText(Year(Currentdate),0,""):
y := 16;
for x := 1 to 16 Do(
Local stringvar z := "";
z := split(showval,"^")[x];
if x = y then
tempStr := tempStr + totext((Sum ({SalesClass.SalePrc}, {SalesClass.RecDate}, "quarterly")+Sum ({SalesClass.DiscAmnt}, {SalesClass.RecDate}, "quarterly")),0,"") + "^"
else
tempStr := tempStr + z + "^"
);
shared stringvar showval := Left(tempStr, Len(tempStr)-1)
The error is happing in this section I believe
z := split(showval,"^")[x];
Any suggestion on how to fix this error is appreciated.