?
Solved

Creating totals in Crystal Reports 2008

Posted on 2011-09-26
10
Medium Priority
?
217 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
[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
  • 5
  • 4
10 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 36600877
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
ID: 36908722
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
ID: 36932711
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
On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 36934572
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
ID: 36950007
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
 
LVL 101

Expert Comment

by:mlmcc
ID: 36950222
Is the remaining amount a field in the database?

mlmcc
0
 

Author Comment

by:meshoxford
ID: 36950363
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 101

Expert Comment

by:mlmcc
ID: 36950596
Try this idea for the grand total

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

mlmcc
0
 

Author Comment

by:meshoxford
ID: 36951005
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 101

Expert Comment

by:mlmcc
ID: 36952391
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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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 …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month8 days, 11 hours left to enroll

764 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