I have a simple question.
Suppose I have a Stored Proceudre that returns a table with the following columns: (Item, GreenColour, RedColour), corresponding to all the possible Items and how many of them are "Green" or "Red". i.e, a possible output could be {(Apple, 4, 2), (Chair, 1, 2)}.
What I want to do in the report is the following:
In the header section, write four columns: "Item", "Green", "Red" and "Total"; where "Total" corresponds to the total per row. Then in the "Details" section adding the "GreenColour", "RedColour" and some other "TotalColours" field (Which I don't know well). And also adding an additional line at the bottom with the totals per column.
This sounds very similar to the "CrossTab" tool, but it can't be done that way. I know a possible answer is modifying the StoredProcedure by adding the "Total" column and compute it in the query. And adding the "Total" per column with a UNION after the query, where "Item" is "Total" and values of "Green" and "Sum" are "SUM" of another query. But I don't want to do it this way, I want Crystal Reports to solve it.
Thanks and I apologize of writing so much for asking such a simple question.
Edit: The wanted output for my example would be:
Item Green Colour Red Colour Total
Apple 4 2 6
Chair 1 2 3
Total 5 4 ¿9?
Also would like to know if it's possible to make both ways with the '9' and without it.
You're right, crosstabs are overkill for this. Just create a formula to sum the colors:
{table.GreenCount} + {table.RedCount}
To get the report totals (the 9 in your example), just insert a summation summary. (Right-click the formula field you just created -> "Insert" -> "Summary" -> "Calculate this summary" as Sum).