I have a problem that I could not solve to generate a report in crystal report
with c#
.
Assuming I have the following table in sql server
- A B C D
- G 3 2 1
- G 5 6 7
- Y 2 5 6
- Y 3 2 3
Which I am interested in generating crystal report
grouped by A and generating a new column using a formula in crystal report of which the new column E is going to be the total sum and division by group between column B and C
Example Group G:
B: 3 + 5 = 8
C: 2 + 6 = 8
E: 8 / 8 = 1
Example Group Y:
B: 2 + 3 = 5
C: 5 + 2 = 7
E: 5 / 7 = .71
So the report would be grouped by column A:
- A B C D E
- G 8 8 1 1
- Y 5 7 6 .71
I applied the formula in crystal report for the grouping of A {Command.B / Command.C} Which is wrong since I do the division for each record of the same group and I will add it.
I am looking for you to first do all the sum of B and all the sum of C and finally divide it, how do I apply it in a formula of crystal report
?