locked
Adding Subtotal and Grand Total in Crystal Report

    Question

  • Hi all,

    I'm creating a crystal report in Visual Studio 2005 Pro edition.
    I want to add a Sub Total and Grand Total for all my records on the report.
    Total I have 2 pages in this report. I directly connect to SQL Express 2005 table.

    Now I have added 2 Summary fields but they sum all the value.
    What I want is "summary value/Sub Total" for each page. 
    And at last page, I want a Grand total.
    So, I use this summary as my Grand Total and I put it inside "Report Footer" section. So, its solved.

    I don't have any column to group.
    But can anyone guide me on SubTotal??? How to do it??

    Thanks.
    scsfdev
    Thursday, February 25, 2010 4:19 AM

Answers

  • Hi,

    I found a soltion in the link below:
    Formula 1 : @Reset
    NumberVar x;
    WhilePrintingRecords;
    x:=0;

    Formula 2 : @Sum
    NumberVar x;
    WhilePrintingRecords;
    x:=x+{DatabaseFiled};

    Formula 3 : @Display
    NumberVar x;
    WhilePrintingRecords;
    x

    Place Formula1 in Page Header and suppress
    Place Formula2 in Details section and suppress
    Place Formula3 in Page Footer and Dont suppress

    http://www.dbforums.com/crystal-reports/1117914-subtotals-page.html

    Hope it will help,
    Harry
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by TMH- Thursday, March 04, 2010 5:44 AM
    Thursday, March 04, 2010 2:19 AM

All replies

  • Hi,

    I found a soltion in the link below:
    Formula 1 : @Reset
    NumberVar x;
    WhilePrintingRecords;
    x:=0;

    Formula 2 : @Sum
    NumberVar x;
    WhilePrintingRecords;
    x:=x+{DatabaseFiled};

    Formula 3 : @Display
    NumberVar x;
    WhilePrintingRecords;
    x

    Place Formula1 in Page Header and suppress
    Place Formula2 in Details section and suppress
    Place Formula3 in Page Footer and Dont suppress

    http://www.dbforums.com/crystal-reports/1117914-subtotals-page.html

    Hope it will help,
    Harry
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by TMH- Thursday, March 04, 2010 5:44 AM
    Thursday, March 04, 2010 2:19 AM
  • Hi,

    I found a soltion in the link below:
    Formula 1 : @Reset
    NumberVar x;
    WhilePrintingRecords;
    x:=0;

    Formula 2 : @Sum
    NumberVar x;
    WhilePrintingRecords;
    x:=x+{DatabaseFiled};

    Formula 3 : @Display
    NumberVar x;
    WhilePrintingRecords;
    x

    Place Formula1 in Page Header and suppress
    Place Formula2 in Details section and suppress
    Place Formula3 in Page Footer and Dont suppress

    http://www.dbforums.com/crystal-reports/1117914-subtotals-page.html

    Hope it will help,
    Harry
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.

    Hi Harry,

    Thanks.
    Its working! :)
    Thursday, March 04, 2010 5:44 AM