Results 1 to 6 of 6

Thread: Subtotal Per Page (Crystal Report)

  1. #1

    Thread Starter
    Fanatic Member aNubies's Avatar
    Join Date
    Aug 2008
    Posts
    558

    Subtotal Per Page (Crystal Report)

    How to print a subtotal base on per page, lets say i have 3 pages in crystal report there should be a subtotal per page. How to do that ?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Subtotal Per Page (Crystal Report)

    Moved To Reporting

  3. #3
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: Subtotal Per Page (Crystal Report)

    You need to use three formulas

    Formula 1 : @Reset
    Code:
    NumberVar x;
    WhilePrintingRecords;
    x:=0;
    Formula 2 : @Sum
    Code:
    NumberVar x;
    WhilePrintingRecords;
    x:=x+{DatabaseField};
    Formula 3 : @Display
    Code:
    NumberVar x;
    WhilePrintingRecords;
    x
    Place Formula1 in Page Header section and suppress
    Place Formula2 in Details section and suppress
    Place Formula3 in Page Footer and don't suppress, this is your subtotal

    JG

  4. #4
    Hyperactive Member
    Join Date
    Jul 2007
    Posts
    479

    Re: Subtotal Per Page (Crystal Report)

    Shouldn't that NumberVar be declared as Shared? Or is that the default in more current versions of Crystal? I thought local was the default so I have always explicitly declared when I need it shared.

  5. #5
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: Subtotal Per Page (Crystal Report)

    Default is 'Global'
    A 'Shared' variable should be used when you need to pass (share) a value from the main report to a subreport or from a subreport to the main report

    In this case I think that a 'Global' or a 'Local' variable will do the job because is in the same main report

    JG

  6. #6
    Hyperactive Member
    Join Date
    Jul 2007
    Posts
    479

    Re: Subtotal Per Page (Crystal Report)

    Wow, learn something every day. Been working with Crystal over a decade and I guess I have never used the same variable name twice for different purposes. I'll watch that in the future. Thanks

Posting Permissions

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



Click Here to Expand Forum to Full Width