Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Code Clarification Question Post Reply Post New Topic
Author Message
viperbyte
Newbie
Newbie


Joined: 13 May 2013
Location: United States
Online Status: Offline
Posts: 38
Quote viperbyte Replybullet Topic: Code Clarification Question
     Posted: 29 May 2013 at 5:37am
Good morning everone,
 
I have a little down time here so I'm looking over a formula that is inserted in the page header section, trying to cram crystal before my next report project is assigned to me.  Can someone please tell me what is happening with the paramters written with brackets right next to them with letters inside them.
 
NumberVar I;
NumberVar K;
NUmberVar L;
Numbervar M;
StringVar StrCategory;
Stringvar StrClass;
StringVar StrAcctCode;
I:=UBound({?Category Code});
K:=UBound({?Class Code});
For L:=1 To I Do
(
    If Len(StrCategory)>0 Then
        StrCategory:=StrCategory+", "+Trim({?Category Code})
    Else
        StrCategory:=Trim({?Category Code})
);
For M:=1 To K Do
(
    If Len(StrClass)>0 Then
        StrClass:=StrClass+", "+Trim({?Class Code}[M])
    Else
        StrClass:=Trim({?Class Code}[M])
);
I:=Ubound({?Account Code});
For L:=1 To I Do
(
    If Len(StrAcctCode)>0 Then
        StrAcctCode:=StrAcctCode+", "+Trim({?Account Code})
    Else
        StrAcctCode:=Trim({?Account Code})
);
"Category Code : "+StrCategory+"     Class Code : "+StrClass+"    Show all records: "+Cstr({?Show All Records})+
"   Account Code: "+StrAcctCode + "        Show Cost : " +{?Show Cost};
IP IP Logged
viperbyte
Newbie
Newbie


Joined: 13 May 2013
Location: United States
Online Status: Offline
Posts: 38
Quote viperbyte Replybullet Posted: 29 May 2013 at 5:40am
I just read my post and I see hearts.  Where ever there are hearts there should be a pair of square brakets with an 'L" inside.
 


Edited by viperbyte - 29 May 2013 at 5:40am
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 29 May 2013 at 6:09am
Hi

Your report parameters are multi value parameters and the formula is trying to extract each value and add to string variable.

The letter right next to parameter consist of a number which is increasing it's value for each 'FOR' loop
Thanks,
Sastry
IP IP Logged
viperbyte
Newbie
Newbie


Joined: 13 May 2013
Location: United States
Online Status: Offline
Posts: 38
Quote viperbyte Replybullet Posted: 29 May 2013 at 7:01am
Great, thanks.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum