Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

issue with displaying data 2

Status
Not open for further replies.

rb2005

Programmer
Mar 7, 2005
110
US
can I concatenate detail data with summary data.

let say the data look like
group 1
col1 col2 col3
A 5 7
B 8 15
C 8 9

Group1 total 21 31

group 2
col1 col2 col3
A 5 7
B 8 15
C 8 9

Group2 total 21 31

Can I display like A+5+7+b+8+15+c+8+9+group1total+21+31
+A+5+7+b+8+15+c+8+9+group2total+21+31
 
You would have to do something like:

//{@reset} for the GH:
whileprintingrecords;
stringvar x := "";
numbervar sumcol2 := 0;
numbervar sumcol3 := 0;

//{@accum} for the detail section to be suppressed:
whileprintingrecords;
stringvar x := x + {table.col1}+totext({table.col2},0,"")+totext({table.col3},0,"");
numbervar sumcol2 := sumcol2 + {table.col2};
numbervar sumcol3 := sumcol3 + {table.col3};

//{@display} for the group footer:
whileprintingrecords;
stringvar x;
numbervar sumcol2;
numbervar sumcol3;
x + GroupName({table.groupfield})+ "Total" + totext(sumcol2,0,"")+totext(sumcol3,0,"");

-LB
 
is this possible if I want to display everything in report footer. I was trying to display in report footer. If I use group fotter then it's creating seperate group for each line. But the requirement is when ever one group ends the next group will start in the same line. Like A+5+7+b+8+15+c+8+9+group1tota+l+21+31+A+5+7+b+8+15+c+8+9+group2tota+l+21+31
 
Note that you asked how to display, and spoke of groups, so LB gave you the solution, now you say the report footer.

Please take the extra 10 seconds to post your requirements accurately.

Remove the group header formula, and alter the group footer formula to:

//{@display} for the group footer:
whileprintingrecords;
stringvar x;
numbervar sumcol2;
numbervar sumcol3;
x:=x + GroupName({table.groupfield})+ "Total" + totext(sumcol2,0,"")+totext(sumcol3,0,"");

Then add in your report footer formula of:
whileprintingrecords;
stringvar x;
x

-k
 
do I need to supress the group footer?
 
You don't have to suppress the group footer, just suppress the formula if need be.

-k
 
If sum(col2) is zero can I display like "+". This is working fine seperately.
I have a formula like if sum(co1,groupname)=0 then "+"
else totext(sum(col2,groupname))
But when I am using display formula it is printing zero.
Any clue? If I change the datatype of the sumcol2 from number to string will it work?
{@display} for the group footer:
whileprintingrecords;
stringvar x;
numbervar sumcol2;
numbervar sumcol3;
x:=x + GroupName({table.groupfield})+ "Total" + totext(sumcol2,0,"")+totext(sumcol3,0,"");


 
You do need a reset formula in the group header (but you wouldn't reset the string:

whileprintingrecords;
numbervar sumcol2 := 0;
numbervar sumcol3 := 0;

You do not need to add a group condition to the sum in your formula. Change the group footer formula to:

whileprintingrecords;
stringvar x;
numbervar sumcol2;
numbervar sumcol3;
x := x + "Group "+GroupName({table.groupfield})+ " Total" +"+"+
(if sumcol2 = 0 then "+" else
totext(sumcol2,0,"")+"+")+
(if sumcol3 = 0 then "+" else
totext(sumcol3,0,"")+"+");

Then display the following in your report footer:

whileprintingrecords;
stringvar x;
left(x,len(x)-1)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top