|
Greetings. I'm new to Crystal Reports, but I've got some SQL experience. I've inherited a reporting system that uses an ODBC connection to aggregate traffic from my web server.
Some background: my report has two groups, one that looks to a parent vendor and one that looks to a sub-vendor. The parent vendor group totals all the traffic that its sub-vendors accumulate.
In the database, the summary is looking at a single grouped value, MBytesSent, associated with a vendor id.
My issue is that I want the parent vendor to round after the sub-vendors are tallied, and what I get right now is a rounding that affects all of the parts of the sum.
For example, in group 2 (sub-vendors) I have 3 clients who have pulled down 1.754 GBs, 0.0055 GBs, and 138.40432 GBs, all taken from a VendorId related to their bandwidth within the reporting dates. I would like their sub-total to work like this:
RoundUp({1.754 + 0.0055 + 138.40432}) = 141 = parent vendor total
instead, I'm getting, effectively, this:
RoundUp({2+1+139) = 142 = parent vendor total
The RoundUp is rounding up all of the smaller amounts before it gives the total, supplying an extra gigabyte to the report, which is incorrect. This get worse (meaning the rift widens between mathematical reality and the report's display) the more contributing sub-vendors I have with an associated parent vendor, essentially by one whole number per sub-vendor.
So, what am I doing wrong? I've tried to keep the unrounded totals in a container function, then pass that container total to a rounding function, but I fear since they're all pulling the data from the same column in the MSSQL database, there's no way around it.
Any help would be greatly appreciated. If I need to explain further, I can try to do that, too, if it helps make more sense of the scenario.
Thanks in advance :)
Edited by Smittles - 15 Sep 2010 at 10:29am
|