Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Creating totals in Crystal Reports 2008

Posted on 2011-09-26
10
Medium Priority
?
222 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

618 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