Solved

Crystal Reports carry forward totals from the previous page

Posted on 2013-01-21
6
2,248 Views
Last Modified: 2013-01-25
Hi Experts,

I am developing a Crystal Report built on finanical data i.e. Date, Month, Debit, Credit, General Ledger Code

The report requires a sub-totals per ledger account, per month and have therefore inserted groups (new page used to start a new page per either Month or GLCode) and summary fields to deal with this.

The report output also requires that I show page totals, a brought forward in the page header and a carry forward in the page footer. The additional complexity comes that the page totals (bfwd and carry forward) should reset in accordance with the grouping.

So far I have:

Entered a formula in the details section of the report, to take the cumulative value of the debits and similarly one for the credits

WhilePrintingRecords;
NumberVar PageDeb_total;
PageDeb_total := PageDeb_total + {Command.DebitLC};

I have then entered a formula in the page footer as below, which shows the page (carry forward) balance correctly:

WhilePrintingRecords;
NumberVar PageDeb_total;

I am however struggling to define the formula to go in the page header which will bring forward the carry forward from the previous page firstly and secondly that will reset to 0 based on the grouping i.e. if either the month or ledger account changes.

Any help or expert tips would be gratefully welcomed.

Thanks experts
0
Comment
Question by:RSTOCKEWLL
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 250 total points
ID: 38801306
The formula in the page header is the same as the one in the page footer.

For the reset I would have though you just needed a reset in the lowest level group - is that ledger code.  I can't see any point in resetting at a higher level because you must hit the lower level end first.

So in the group footer...

WhilePrintingRecords;
NumberVar PageDeb_total:=0;
""
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 38801383
WHat do you need on the page footer and header when the group changes?

mlmcc
0
 

Author Comment

by:RSTOCKEWLL
ID: 38801433
Hi All,

I had tried initially using the below formula in the header:

WhilePrintingRecords;
NumberVar PageDeb_total;
//PageDeb_total := 0

If OnfirstRecord Then 0
else {@PageDebTotal}

Whilst this works on the first page of the report in that it starts the count from zero and similarly the totals at the footer of the page, based on the formula previously posted also shows the correct value e.g. CreditTotal = 4334.01 (this is correct). However when I look at the second page the Page Header displays an opening (brought forward) balance of 4590.21 and not 4334.01 as I would have expected. On examining this further I see that the difference between the values equates to the first 'credit' record (details section) in the second page and therefore that the balance displayed in the page header of page 2 is the 4334.01 brought forward + 1st record of the second page (details section) = 4590.21....

I guess I have overlooked something further.

Regards the resetting at the lowest level of groups, I think this will be the answer to the seconday problem and therefore just need to overcome this problem.

Thanks

Rick
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 35

Accepted Solution

by:
James0628 earned 250 total points
ID: 38804582
What is @PageDebTotal?  If that's the formula that adds to your variable, then I think that's the problem.  What you're saying is if this is the first record, just display 0, otherwise evaluate that formula, which adds the value from the first record on the current page to the total.

 What you should have in the page header is just:

WhilePrintingRecords;
NumberVar PageDeb_total


 That should just output the current total, which should be from the last record on the previous page (or 0 for the first page).

 James
0
 

Author Closing Comment

by:RSTOCKEWLL
ID: 38815767
Excellent job, both of my problems resolved with the solutions suggested.

Great job

Thanks
0
 
LVL 35

Expert Comment

by:James0628
ID: 38817957
You're welcome.  Glad I could help.

 James
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
All of the resources available today make learning a new digital media easier than ever-- if you know where to begin. This is a clear, simple guide to a few of the basic digital art mediums and how to begin learning them on your own.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question