friendz am stuck at a point that in crystal Crosstab report, i need to have sum of only two column's value and subtract the total by the value what should i do?
as in below,
Product 1 Product2 Product 3 Total
----------------------------------
Cust 1 4 5 2 11
Cust 2 5 9 7 19
I want to sum values of "Product 1","Product 3". then subtract from row total=> Total LIKE [4+2]-11=>TOtal. and want to repeate this for each customer..
the way which I using to solve is.....[this is basicly C.R formating Display String Formula with VB Syntax]
Global totprodsum as int
Global Ccust As String
Dim Ldept As String
Whileprintingrecords
if (Ccust="") then
totprodsum=0
totprodsum=totprodsum+currentfieldvalue
Ccust=gridrowcolumnvalue("Table_Customer.Name")
formula=currentfieldvalue
else
if Ccust<>gridrowcolumnvalue("Table_Customer.Name") then
totprodsum=0
totprodsum=totprodsum+currentfieldvalue
else
totprodsum=totprodsum+currentfieldvalue
formula="Newag"
end if
formula=currentfieldvalue
end if
Ccust=gridrowcolumnvalue("Table_Customer.Name")
but its not working bacause Crystal report generates report in this sequence
Cust 1 <1st col value>
then.....
Cust 2 <1st Col Value>
then..........
Cust 1 <1st col value> <2nd Col Value>
Cust 2 <1st Col Value>
then ....
Cust 1 <1st col value> <2nd Col Value>
Cust 2 <1st Col Value> <2nd Col Value>
then .....
Cust 1 <1st col value> <2nd Col Value> <3rd Col Value>
Cust 2 <1st Col Value> <2nd Col Value>
then..
Cust 1 <1st col value> <2nd Col Value> <3rd Col Value>
Cust 2 <1st Col Value> <2nd Col Value> <3rd Col Value>
while I want crystal report to Execute report like this
Cust 1 <1.1> <1.2> <1.3>
then......
Cust 2 <2.1> <2.2> <2.3>
anyone please help me out.