Solved

Creating totals in Crystal Reports 2008

Posted on 2011-09-26
10
198 Views
Last Modified: 2012-05-12
I created an outstanding invoices report in Crystal Reports 2008.  The data is pulled from an Access database.

I have a formula that calculates the remaining amount for each OPEN contract.  In order for that formula to work I had to have all invoices included in the report.  Then I used if then else statements to make it so that  the entire row would be "blank" for each invoice that has been paid.  I then used the Section Expert (by right clicking on Details in design view) to "Suppress Blank Sections."

The report is now how I want it except for TOTALS.  

I want a grand total for remaining amounts and a grand total for unpaid invoices.

I cannot use a "summary" to sum either of them up because of how the report was created.

Is there another way for me to total these two columns?  If so, how?




Thank you in advance for your time.
0
Comment
Question by:meshoxford
  • 5
  • 4
10 Comments
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
Not sure why you can't use a summary provided you get the data set correctly.

A formula like

If (HidingFormula) then
   0
Else
   {Amount Field}

You should be able to summarize that to get the value.

If not the please upload the report.

mlmcc
0
 
LVL 1

Expert Comment

by:Hlanai
Comment Utility
Don't pull the fully paid invoiced to the report so that you can suppress the lines. Filter out the fully paid invoices in the record selection so that none of the fully paid invoices appear on the report, whether suppressed or not. Once you do this, then you can do a simple some of those amounts.

It is that straight forward, unless I misundetstood your question.
0
 

Author Comment

by:meshoxford
Comment Utility
Hlanai:

I originally used record select to show only unpaid invoices.  The formula to calculate the remaining amounts per contract looked something like this:
{table1.originalAmount} - Sum({table2.invoiceAmount}, {table1.contractNumber})
CR only summed the invoices that were in the report, then.
Also, using record select made it so that only contracts with unpaid invoices showed up in the report.  I need remaining amounts for all open contracts whether there are unpaid invoices or not.  
This is why I created the report the way I did.




mlmcc:

As far as getting the data set correctly, I returned blank strings for all data fields relating to each paid invoice so that I could suppress those sections.
The two reason I even have the paid invoices in the report is so that
(1)  I could calculate the remaining amounts for each contract and
(2)  All open contracts and their remaining amounts showed up.
Like I said that made it so that my report showed exactly what I wanted.  So to clarify, the report is essentially outstanding invoices AND amounts remaining.

When I select Insert - Summary and then select unpaidInvoices from the drop down menu, the options in the next drop down of how to summarize the options are Maximum, Minimum, Count, etc.  BUT Sum, Average, Median, etc. are not included.  I am assuming that this is because I am returning a blank string (as explained above).

If you could clarify where you would put this:
If (HidingFormula) then
   0
Else
   {Amount Field}
then I will be able to let you know if it will work.




Both:

I hope I didn't confuse you even more.  This should hopefully break it down:

Please let me know if you know a better way to filter, hide, or suppress the paid invoices in a way where I will be able to:
(1)  Show the remaining amounts for each open contract whether the contract has unpaid invoices at the time or not.
AND
(2)  Calculate these remaining amounts CORRECTLY.
AND
(3)  Summarize the unpaid invoices as a grand total in the footer.




p.s. I would like to summarize the remaining amounts as a grand total in the footer too, but when I go to Insert - Summary, the pull down menu does not include my report field amountRemaining.  I am assuming this is because there is a Sum in the formula for the field.  This is one item I would like to have in the report but it will not make or brake it.  Please let me know if you have any ideas as to why it will not let me summarize that field.
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
Comment Utility
If (HidingFormula) then
   0
Else
   {Amount Field}


I would put it in the detail section then summarize it.  Once you have the summary you don't need it in the report

To get a grand total of a summary just copy the summary and put it in the report footer.

mlmcc
0
 

Author Comment

by:meshoxford
Comment Utility
mlmcc:

I see what you mean now.  That is so simple I cannot believe I didn't think of it myself.  It worked perfectly for the invoices, but I still can't get the remaining amounts to total.  Do you have any suggestions for that?
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
Is the remaining amount a field in the database?

mlmcc
0
 

Author Comment

by:meshoxford
Comment Utility
mlmcc:

No.  It is a field in my report.  The formula looks something like this:

{Table1.originalAmount} - Sum ({Table2.invoiceAmount}, {Table1.contractTitle})

If it were a field in the database then my report would have been much simpler.  It is actually a query in the database.  
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
Try this idea for the grand total

Sum({Table1.originalAmount}) - Sum ({Table2.invoiceAmount})

mlmcc
0
 

Author Comment

by:meshoxford
Comment Utility
mlmcc:

I tried that earlier!  There must be a lot of incorrect numbers from years ago so the total does not come out right.

Thank you for all of your help.
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
If you have bad data then you really can't do much in the report unless you can determine it is a bad record and ignore it.

mlmcc
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now