crystal reports total of values field - crystal-reports

I'm using Crystal Reports 10 right now and I have my report almost finished. I have a group of customers and for each customer, I have multiple lines of customer information. The one thing I'm still trying to figure out though is how can I get a running total of one column's distinct values.
So, for example I have a customer Bob who has 6 different items. For each item, there is a manufacturer. It might be the same for all 6 items, it might be one for 3 of them and another for the other 3, or they might all be different. What I want is to have a field at the bottom of the group for Bob that would say:
Man1 - 3
Man2 - 1
Man3 - 2
with the manufacturer being on the left side and the number of items they make for that customer on the right side.
Is there anything in Crystal Reports that can do this right now? Or can someone give me some advice on where I would get started on a formula to do this? Thanks for any help you guys can give.

Need more information:
What kind of data structure are we talking about? How are the manufacturer and item data found? How are these related to the customer? How many manufacturers/items are typically found per customer?
If the manufacturer and items are two different fields, that might be simple (cross tab in customer group). If they are free form, that might be a problem. If there are separate fields for every manufacturer (I've see it happen), then that might be a problem.
Best scenario:
One field for manufacturer, one field for item, distinct relation to customer.
Possible solution:
Group by customer, sub-group by manufacturer, count of items.
Not best scenario:
Table for customer, separate table for each manufacturer.
Possible solution:
Main report, group by customer. Linked subreport on Manufacturer/items.
Worst scenario:
Free-text entry of manufacturer and items in a memo field.
Possible solution:
Redesign your database (grin).
If you have to, you can do this using logic tests through formulas, but if you have many manufacturers/items, it would get exhaustive.
Best answer: More information.

Related

How to show duplicate data across several entities in a report

I'm working on a report that retrieves information from several entities across our application.
The query I use retrieves all the employee numbers across diferent entities and displays them correctly, including duplicate numbers that exist across them, which is possible.
Example:
Entity 1 Employee John has number 1001
Entity 2 Employee Frank has number 1001
This is all correct and possible, but when I generate the report, it does not show all the numbers, as some of the duplicate ones are not shown.
If I were to use the example above when generating the report, only one of the numbers 1001 would show.
Is there a way to tell Crystal Reports to show everything including all the duplicate values?
Other main suspects are: Table joins and record selection formula.

Need to group multiple fields together to form one group

Not sure if this is possible, but I thought I would put this out there and see what anyone thought.
Report: I need to track by classroom the parents that have given vs. those that I have not. I had created this awesome report with those that had, but I could never figure out how to pull the parents who hadn't yet in to the report. I need those that have not as well to create a sum and percentage of parents each class. (first query was too narrow, the next one gave too many dates and gifts, which duplicated the names in the report)
So I'm trying a different route and took the data from an Export instead of a Query, but now the "Classroom Guide" field is in a separate column for each child they have at the school.
I need to combine the 4 Guide fields somehow so I can group by them to create the classrooms in the report.
Makes sense?
Example data is like:
first.name;last.name;Guide1;Guide2;Guide3;Guide4;Gift.Date;Gift.Amount

Removing duplicate record text but keeping unique values

In our system, it shows each charge as a record, despite the account being the same.
Crystal reports image
How would I go about doing this?
Also, is there a way to show it like this even though they are all seperate records?
Option 2
You can solve this using sub reports.
In main report take distinct record and place the fields Account and city in detail section.
Now take sub report and place it after the first 2 columns in detail section but take care that you won't select the option distinct records that means you retrieve all records. In sub report place Charge type, charge fields

How to select a specific record/row of data in Crystal Reports?

I have my sql database Views available to my report, but sometimes they return multiple values, for example I have one that shows me the Total Credits for a range of years.
When I click "Browse Data.." it lets me see what bits of data are available
Eg:
Credits
-------
31
45
460
But I want to select 45 (based on a customer ID)... is it possible to do this?
EDIT: An alternative is if I can link the Customer ID from two views, but only if it's not null (as sometimes there are no records in the Credits)
To avoid the problem of unintentionally "deleting" customers from the report results, first do a left outer join between the CONTRACT_VIEW and the year views, such as TOTAL_2013. In your selection formula, instead of just doing something like {TOTAL_2013.Customer_ID}=MyCustomerID, add all the nulls to it as well, so: isnull({TOTAL_2013.Customer_ID}) or {TOTAL_2013.Customer_ID}=MyCustomerID. This will prevent customers who don't have any entries in the by-year views from being removed completely from the report.

Multiple groups in Crystal Reports

How can I use multiple groups — which are not nested — in Crystal Reports?
A little Example of what I want to do:
-hire car header
--rentals header (group)
---rental from 01-02-2008 to 01-06-2008
---rental from 01-08-2008 to 01-09-2008
---rental from 01-12-2008 to 01-15-2008
--rentals footer
--repairs header (group)
---repair from 02-02-2008 to 02-05-2009
--repairs footer
-hire car footer
hire car is the normal report, and rentals and repairs are the groups. The groups are not nested. My current problem is that I can't really create something like that, and I can't change the structure to solve this problem...
I'm totally new to crystal reports.
That's a good question. I would call that a double one-to-many. You have "hire car" which can have many rentals and/or many repairs.
One solution would be to use two sub-reports for the rentals and repairs.
Another solution would be to union together the repairs and rentals. Then have crystal group on the column that specifies if the row is rental or repair data. You would also have to show/suppress the correct labels, fields, etc. This get's very clunky so your best bet is to go the sub-report route.