hi everyone,
I am using crystal reports XI and I am displaying the usergroup name from usergroup field in the database using arrays.
I created two formulas in subreport:
formula 1: To Initialize arrays
formula 2: To store values into an array
And in main report,I have created another formula(@Display Group Name) to retrieve the values and I put the formula in detail section.
Also my report is grouped on liaison name field and security type id field.
The problem is when there is more than one security type id for any particular liaison name I am getting repeated usergroup name on my report which I don't want.
Here is my code:
For the subreport:
Formula 1: (Ini Vars)//Initializing arrays to display usergroup name (Placed in RHa and suppress the section)
shared stringvar array gName;
shared numbervar array gID;
shared numbervar gNameSize := 0;
redim gName[995];
redim gID[995];
""
Formula 2: (Pop vars) //populating variables to display usergroup name (Placde in GF1 and suppress the section )
shared stringvar array gName;
shared numbervar array gID;
shared numbervar gNameSize;
local numbervar i;
gNameSize := gNameSize + 1;
i := gNameSize;
if i <= 995 then
(
gName := {usergroup.usergroup_name};
gID := {usergroup.usergroup_id};
)
** Group By usergroup.usergroup_id
For the Main Report:
Create a formula by name @Display Group Name (placed in a detail section)
//This formula is to display UserGroup Name
shared stringvar array gName;
shared numbervar array gID;
shared numbervar gNameSize;
local numbervar i;
local stringvar tString;
For i := 1 to gNameSize step 1 do
(
if gID = {vtsm_audit_log.group_id} then tString := gName
);
tString;
Please help me out.I got stuck,please help!
Thanks in advance
makk07
I am using crystal reports XI and I am displaying the usergroup name from usergroup field in the database using arrays.
I created two formulas in subreport:
formula 1: To Initialize arrays
formula 2: To store values into an array
And in main report,I have created another formula(@Display Group Name) to retrieve the values and I put the formula in detail section.
Also my report is grouped on liaison name field and security type id field.
The problem is when there is more than one security type id for any particular liaison name I am getting repeated usergroup name on my report which I don't want.
Here is my code:
For the subreport:
Formula 1: (Ini Vars)//Initializing arrays to display usergroup name (Placed in RHa and suppress the section)
shared stringvar array gName;
shared numbervar array gID;
shared numbervar gNameSize := 0;
redim gName[995];
redim gID[995];
""
Formula 2: (Pop vars) //populating variables to display usergroup name (Placde in GF1 and suppress the section )
shared stringvar array gName;
shared numbervar array gID;
shared numbervar gNameSize;
local numbervar i;
gNameSize := gNameSize + 1;
i := gNameSize;
if i <= 995 then
(
gName := {usergroup.usergroup_name};
gID := {usergroup.usergroup_id};
)
** Group By usergroup.usergroup_id
For the Main Report:
Create a formula by name @Display Group Name (placed in a detail section)
//This formula is to display UserGroup Name
shared stringvar array gName;
shared numbervar array gID;
shared numbervar gNameSize;
local numbervar i;
local stringvar tString;
For i := 1 to gNameSize step 1 do
(
if gID = {vtsm_audit_log.group_id} then tString := gName
);
tString;
Please help me out.I got stuck,please help!
Thanks in advance
makk07