Results 1 to 4 of 4

Thread: Newbie

  1. #1
    Join Date
    Feb 2004
    El Salvador

    Unanswered: Newbie

    I've just started using crystal reports, and I'm having a problem.

    I'm trying to make a report of items that is grouped by it's class. I need three different totals for each item. One when doctype=1, another when doctyp=2 and the last when doctype=3. Each item has lots of doctypes.
    My question is, how do I obtain those totals?
    Here's an example:

    Budweiser Total1 Total2 Total3
    Miller Total1 Total2 Total3
    Coke Total1 Total2 Total3
    Pepsi Total1 Total2 Total3

    total1=sum for each item when doctype=1
    total2=sum for each item when doctype=2
    total3=sum for each item when doctype=3

  2. #2
    Join Date
    Oct 2003
    In SQL terminology, what you are asking for is a report that is group(ed) by "class."

    If you could be satisfied by presenting these totals (for a particular group) "immediately after" that group, then you can accomplish that requirement very simply with group-bands. Basically, Crystal Reports maintains the totals itself for each group and prints them out when it realizes that a particular group of records is complete.

    On the other hand, if you require these totals to appear at the end of the report, after all of the rest of the output has been completed, then what you must do (unfortunately...) is to arrange for the results of an entirely separate SQL query to appear in that position; in other words, a "sub-report."

    Quite frankly, I advise that you change the requirement. Put the group-subtotals after each group. "It's easier that way, much easier, and humans can adapt much more easily than computers can."
    ChimneySweep(R): fast, automatic
    table repair at a click of the

  3. #3
    Join Date
    Mar 2004
    Calgary, AB Canada
    Are you looking for this formula?

    if DocType = 1 then

    You'll have two more for DocType = 2 and DocType = 3 and on and on...

    Add the new formulas to the report and add sub-totals for them.

    Is that what you're looking for?


  4. #4
    Join Date
    Feb 2004
    El Salvador
    yes, thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts