Solved

Crystal Reports report help with multi tables

Posted on 2013-01-17
4
354 Views
Last Modified: 2013-01-18
Hi. We have a database that holds 2 tables 1 named  summary and one named detailed. Both tables have a common field policy number. Reports are normally run from the summary table which summaries finance data etc..... I need to create a report that will show amounts for different payments but in a summary line of data. So policy number 123 has payments of 100 in the summary table. In the detailed table the same record is shown 3 times as the payment is split into 3 different types, clothing 30, food 30 and travel 40. I'm trying to create a report that can show the summary data and in addition the clothing payments, but show all records from the summary table. So for example policy number 123 payments 100 clothing payments 25, if no clothing payments are present then return null or zero. When I link the tables and run the report their policy number is duplicated as it is matching the record from the summary table with the multi records in the detailed table, I only want one line of data. Any suggestions
0
Comment
Question by:George_Milton
4 Comments
 
LVL 42

Assisted Solution

by:zephyr_hex
zephyr_hex earned 50 total points
Comment Utility
it sounds like you need to create a group on Policy Number in your report and put the fields from the summary table in the section for the Policy Number group.
if you then want to show detail records, the fields from the details table would go in the Details section of the report.

if this does not sound like your solution, would you please provide the SQL query from the report?  you can get it by using Database->Show SQL Query in the report.
0
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 50 total points
Comment Utility
Agree, you need to group the data and use the group header/footer for the displayed data.

If you can explain how the detail records are it would help determine what other formulas are needed.

For insance if you have a $100 payment split as you show above is there 1 detail record or 3?

mlmcc
0
 

Author Comment

by:George_Milton
Comment Utility
Hi, thanks for your help so far, just a bit more detail.
The summary table has a record that looks like this
Policy number      Total Payments
12345                    100

In the detail table the same record looks like this
Policy number        Payment Desc        Payment amount
12345                     Clothing                  30
12345                     Food                        40
12345                     Travel                      30

So the record is present 3 times in the detailed table. Im looking for one line of date that would look like this
Policy number Total Payments Clothing payments
12345               100                   30

When I create the links for the tables I use the policy number to match. I think have a formula which looks at the Payment desc, if this equals clothing then show the payment amount
When I run that is part works but the policy number is duplicated the amount of times that it appears in the detailed table, so I get the following

Policy number   Total Payments   Clothing Payments
12345                 100                      
12345                  100                    30
12345                  100                            

I really just want to see one line of data as follows

Policy number Total Payments Clothing payments
12345               100                   30


I hope that makes some sense, I only really have a basic understanding of Crystal. (the data given is just an example)

Thank
0
 
LVL 77

Accepted Solution

by:
peter57r earned 195 total points
Comment Utility
You have two options in Crystal to handle this.
You can suppress detail lines where the decsription is not Clothing by setting a suppression formula of:
{yourtable.descriptionfield}<>"clothing"

This is done in the Conditional format button for Suppress option in the section expect for the Detail Section.


The alternative is to base your report on a SQL command.
You have to create this in the syntax that is used by your database.  Select the Add Command option from the database expert once you have selected the database.

It will be something like..

Select Summarytablename.*, q1.* from
summarytablename left join
(Select * from detailtablename where description = "Clothing") as q1
on summarytablename.Policynumber = q1.policynumber

You cannot use the select expert in crystal for this requirement because you want to show all records from the summary table and the two features do not work together.
If you did Not want to show all summary records, just those with clothing records in the detail table, then you Could use the select expert.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

763 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