Crystal Reports Rows in Group - crystal-reports

I have a report grouped by Supplier. In the details section for this group, there are customer names with other fields of information. The problem is that a customer may be listed several times, but I only want one record to show per customer.
Supplier
John Doe 10/15 $25.00 Eggs
John Doe 10/15 $29.00 Milk
Susan Weva 10/12 $15.00 Corn
Susan Weva 10/18 $11.00 Bread
What I want is one complete row for John Doe and one for Susan Weva. Any idea as to how I can do this? I tried to suppress each field, but that did not seem to work.

There is one way (which i use in this situations) and it work.
So your data looks like this
John Doe 10/15 $25.00 Eggs
John Doe 10/15 $29.00 Milk
Susan Weva 10/12 $15.00 Corn
Susan Weva 10/18 $11.00 Bread
From what i have understand you want to have your output like
John Doe some columns
Susan Weva some columns
To show it only once per group put fields in group header or group footer. In your case all other columns are different and you should "summarize" those fields. For field price is easy, just do summarize by group and you have for each person amount. But dates and last columns makes a problem. So you should learn about using Cross-tab to solve this problem. If you need only sum of price, then put fields in group header or group footer and it will be show only once per group.
Hope it helps

Related

Crystal Reports: multiple columns by group

I am working on a report that and by using Format with multiple columns and Format groups with multiple columns, the report displays data like this.
station 1 Station 4
Mike Barry
Sam Jim
Abe Gary
Station 2
Ruth
Ben
Karim
Station 3
Cat
Billy
Erin
And so on. The report is grouped by the station and I want the report to display data like this.
Station 1 Station 2 Station 3 Station 4
Mike Ruth Cat Barry
sam Ben Billy Jim
Abe Karim Erin Gary
I looked through the search information but did not find a way for me to list the group and the data side by side.
Open the section expert, layout, print direction, set "Across then Down".
Adjust the width of the section to fit 4 columns.
I figured it out. I needed to insert a group footer (not suppress it), and have it set to "print at bottom of page."

IReport - multiple grouping

I need group data by 5 fields. It's ok, but I need show "Totals" in a new page after each first grouping.
Example:
Birth Nationally Car Job Name Money
1980 North American BMW Doctor Paul $1200,0
1980 North American BMW Lawyer Longman $2700,0
1980 North American Mercedes Nurse Lenna $4200,0
1980 Canadian Mercedes Police John $1300,0
1993 Italian Ferrari Pilot Marco $1500,0
I build my report in this way:
- Main report contain a subreport;
- Subreport (where the groups are):
Birth group header
Nationally group header
Car group header
et...
Car group footer
Nationally group footer
Birth group footer (here I put a SECOND SUBREPORT, that need be in a new page)
Second Subreport: contains the totals by birth, nationally and car, but only actual birth. After each Birth, I need show the sum of money. So, after 1980 would be shown:
1980
Nationally: North American Car: BMW Total: $3.900
Nationally: North American Car: Mercedes Total: $4.200
In a first moment, my subreport 2 didnt work because has no data. So I copied the original data for each object (list X that contains list X). So the subreport 1 uses list X e and pass list X to subreport 2.
But I don't know how to filter the Birth in subreport 2.
Is my solution correct? If yes, how to solve the problem of subreport 2. If no, how should I build that?
Thanks in advance.

Jasper Report - Format Crosstab

From a query, I get this data (simplified):
Referring Date Name Budget
2017-01 JACK 100
2017-01 JOHN 200
2017-01 SMITH 150
2017-02 JACK 50
2017-02 SMITH 200
2017-03 JOHN 300
2017-03 SMITH 200
2017-03 JENNY 150
I need a crosstab to organize budget on columns and referring-date and name on rows.
Using Jasper Wizard, I got this:
As you see, Referring Date is put in a Rowspan.
Unfortunally, Im requested to build something like this:
I've tried to modify Crosstab but when I try to move Referring Date above Name (companyName in my case) I got the error because Im "invading" company section.
Is there a solution?
Thank you!
Yes its possible. Don't use Cross tab. Learn and use report Group. Create group on "referring date".
For Total create a variable of data type same as $F{budget}.Set the Calculation to 'Sum', the Reset Type to 'Group' (and pick the appropriate group from the dropdown), set the variable expression to $F{budget}.

Distinct count not giving expected result

I have fields for customer names, customer account numbers, date of previous orders, and order values. I want an alert to show which customers have ordered at least three times over the reporting period. We can have more than one invoice for a given delivery. The main report looks like:
Account Number Acct Name Order Date Order Total
1001 Fred Smith 1/2/2016 £1.06
1001 Fred Smith 1/2/2016 £2.34
1001 Fred Smith 8/2/2016 £5.42
2001 Aled Jones 1/2/2016 £2.90
2001 Aled Jones 8/2/2016 £3.45
I've tried concatenating the account number and order date in a column via function and running an alert based on its distinct count. (After converting the date to a string.) But it still doesn't generate a list of distinct items.
What I currently have in the final column is a function that concatenates the date and account number to give a unique field with {ORDR.CardCode} + Cstr({ORDR.DocDate}) - Which returns:
1001 1/2/2016
1001 1/2/2016
1001 8/2/2016
2001 1/2/2016
2001 8/2/2016
I want to generate alert based on this field via the distinct count function and a report of any customer who ordered at least twice in the report period.
DistinctCount ({#Concat code and date}) >2
Even after this I still don't get what I need. How can I get a list of every customer who has ordered in the report period for at least two times?
You have travelled half way... to achive continue from here.
USe the created formula {ORDR.CardCode} + Cstr({ORDR.DocDate}) to create a group.
place same formula in details and take count of the records in group footer
Now create a alert on group footer summation to get the desired result
Edit........
Since you need customer then add customer in concat fornula and then create group.
acctnamr+{ORDR.CardCode} + Cstr({ORDR.DocDate})
Now place the customer name in group header and follow process as explained above

Suppress duplicates of a group data which is in another group data in crystal reports

Cystal Reports
scenario:
Group1 Location
Group2 Names
Group2 is below the Group1 in heirarichy.
I placed Group1 field location in Group2 names. I have seen duplicates of locations.
Sample data:
america Tom
america Jim
England Peterson
England Anderson
I want data as
america Tom
Jim
England Peterson
Anderson
Please provide solution.
Thanks in advance.
Unfortunately, the suppress duplicates option only works in the detail section. The simplest approach here would be to conditionally suppress the Group1 field with a condition like {Table.Location} = Previous({Table.Location}) (assuming you have your fields in the group2 header).
EDIT: Since you have your fields in the Group2 footer, I suggest adding a new running total field, to be incremented on change of group2 and reset on change of group1, and conditionally suppress the Group1 field with a condition like {NewRunningTotal} > 0.
Assuming that you have the correct group-name field in each group's group-header section, change group header one to 'underlay following section'.