Home RAP

Calculating totals

edited October 2002 in RAP
I am new to RB6 so any help will be greatly appreciated. I am trying to
create a report based on the information in a set of DBISAM tables.

Table1: Message
Fields: MessageID, Sender, SentDate, MessageBody,

Table2: MessageTo
Fields: MessageID, Recipient, ReceiveDate, DeliveryStatus

I've establish a one-to-many relationship between Message and MessageTo
tables via the MessageID field within Delphi 6.

When a message is sent to a list of users, the message is formatted and
addressed on the client side and then sent to the messaging server (Simliar
to email). The messaging server then forwards the message to the intended
recipients based on their connected state. The server makes the following
analysis when attempting to send the message and updates the DeliveryStatus
field in the 'MessageTo' table.

Here is status information in the MessageTo table and their representation

1 - Undelivered
2 - Delivered
3 - Performed
4 - Denied
5 - Expired
6 - Acknowledged
7 - Agree
8 - Disagree

What I am trying to do is create a report based on totals for each delivery
status for a given message that is sent. I can do all this within Deliphi
but I've been instructed to do it within RB6 t off-load the processing from
the main server.
So where am I at with this report? Well, I created a report with the
following database tables, Message & MessageTo. I added the respected fields
from the Message table in Design view, such as From, To, Sent date, Subject,
Message Body. I created a group based on MessageID field from the Message
table and then place a series of Variable componets in the Detail section to
sum the delivery status for each message. The vailable components are lable
as follows,

Total - Undelivered
Total - Delivered
Total - Performed
Total - Denied
Total - Expired
Total - Acknowledged
Total - Agree
Total - Disagree

Now I am having a trouble trying to get the totals for each DeliveryStatus
for a given MessageID. I tried everything I know but can seem to get an
accurate count. I believe my problem lies in timing. I assuming I need to
use RAP for this feature to work?
Can any help or lead me in the right direction.

Thanks.

Comments

  • edited October 2002

    Create a group in the subreport on MessageID. Add TppVariables to the
    GroupFooter. By pressing the right mouse button over a variable and
    selecting the Timing... menu option you can configure the Variable to reset
    the totals when the group breaks.

    Use the Variable.OnCalc to accumlate the totals. (For very simple totals you
    can use DBCalc rather than Variable).

    See the Calculations thread of the Tech Tips newsgroup for articles on
    performing calculations and see the tutorials in the Developers Guide.


    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.