Link to home
Start Free TrialLog in
Avatar of Fikri XXXXXXXX
Fikri XXXXXXXX

asked on

Crystal reports subreports as total of main report

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
Avatar of Mike McCracken
Mike McCracken

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
Avatar of Fikri XXXXXXXX

ASKER

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?
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
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
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
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
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?
Have you tried a cross tab?

I inserted on in this version.

mlmcc
rptSOcross.rpt
You can also do this by building the list you want to use

mlmcc
rptSO-array.rpt
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.
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, that is it..  Some typing errors but it is ok..

Thank you
Thank you....