Solved

Crystal reports subreports as total of main report

Posted on 2016-10-25
13
69 Views
Last Modified: 2016-10-27
Hello to all. I am newbie so I need your help.
I have situation in crystal report x10.

Group header fields:

NAME OF PRODUCT (given by formula) and QTY (from the database)

SAMPLE 1                                                              10
SAMPLE 2                                                              20
SAMPLE 2                                                              20
SAMPLE 3                                                              30

I need result like this: in the report footer of the main report

SAMPLE1                                                               10
SAMPLE2                                                               40
SAMPLE3                                                                30

I am trying to do it by adding subreport in the footer of main report, linked NAME OF PRODUCT (main report) to NAME OF PRODUCT (Subreport), but it show me only last record (SAMPLE3) multiple times.
What I am doing wrong, is there any other way to do this?

Thanks
0
Comment
Question by:Fikri XXXXXXXX
  • 7
  • 6
13 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 41859015
The footer of the main report only has the data from the last record.

If you want a subreport in the report footer why link it at all?

You could put it in the group footer then link by product name

mlmcc
0
 

Author Comment

by:Fikri XXXXXXXX
ID: 41860583
Yes, but on that way I get subreports item after every group of main report.
How can I add subreport to report footer on main report? What should I do in subreport?
Add field from main report into detail section, do running total in the subreport, supress detail section in subreport?
Am I on right way?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 41860621
What do you want the subreport to show?

If you put it in the report footer then don't link on a given field.

mlmcc
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:Fikri XXXXXXXX
ID: 41860671
I need to show something like total on the main report footer. I explained before.
Please check my question above.
Can you explain to me step by step how to do this?
Thanks
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 41860877
Can you upload the report?

I am confused because in the sample in the question you say the data is in group headers yet 2 of the groups have the same name which isn't possible.

Do you just need a summary of the quantity or do you need the total by group name in the main report footer?
If all the data is in the main report have you tried using a cross tab?

mlmcc
0
 

Author Comment

by:Fikri XXXXXXXX
ID: 41861927
I need total by group name in the main report.
It tried cross tab but format is not good.
Please check this

http://www.filedropper.com/rptso

Total should be by ARTICLE and QTY in the report footer.
 Thanks
0
 

Author Comment

by:Fikri XXXXXXXX
ID: 41862027
Names of article are given by formula in report so they can be same. Problem is how to do sum of them and group them so article should be appear only one time?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 41862306
Have you tried a cross tab?

I inserted on in this version.

mlmcc
rptSOcross.rpt
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 41862324
You can also do this by building the list you want to use

mlmcc
rptSO-array.rpt
0
 

Author Comment

by:Fikri XXXXXXXX
ID: 41862595
Cross tab shows wrong results from some reasons?
Building array can be great idea. It works well, but problem is that ARTICLES are not grouped.
Need to make some function to check if articles exist already in array and if exist then only add QTY to that record in array.
If not then this code is ok. This is because I have situation that some articles are showed multiple times..

Thanks for your help.
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 41862700
Sorry, I forgot to combine them.

I updated the report to search and add or create a new record.

mlmcc
rptSO-array.rpt
0
 

Author Comment

by:Fikri XXXXXXXX
ID: 41862735
Yes, that is it..  Some typing errors but it is ok..

Thank you
0
 

Author Closing Comment

by:Fikri XXXXXXXX
ID: 41862739
Thank you....
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

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. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 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