Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple items in the subreport details

Status
Not open for further replies.

metalgears

Technical User
Apr 8, 2005
13
CA
Hi all,

I have a main report with a sub report linked by a sequence number field.

When I run the report there are multiple instances of the same item in details of sub report because the sub report displays items by sequence numbers.

Is there a way to summarize the items that are the same in the sub report?

I was thinking of putting the items into and array and just have it loop thru the array and any matching items will be deleted? but i have no idea how i would do that in Crystal.

Thank you.
jnsimex
 
To clarify, the subreport shows everything for the sequence number field, but there are many of these? (If not, you need to make sure that the subreport uses the sequence number field to select.)

If there are several details for the same sequence number field, and you don't want to see them, then have the subreport group by sequence number field, suppress the detail lines and show just the group header or footer.

Or have I misunderstood? I don't follow what you say about arrays, though I believe arrays can be passed to subreports.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Hi Madawc,

I am very new to Crystal Reports so I may not explain everything very well.

In Accpac, we setup up optional fields for GL Entries.

So after an account is entered, you then choose a project name and then a project category from a drop down box.

In the main report, I have it group by project name and in the sub report, I am showing all the project categories and amounts that relate to the same project.

I.E.

(Main)
Project Acme
(Sub)
Entry #1 category 1 $1.00
Entry #2 category 2 $5.00

The sub report is filtered by two fields that the main and sub have in common (sequence number, detail number)


The problem I am having is when there are when multiple entries with the same categories.

I.E.

(Main)
Project Acme
(Sub)
Entry #1 category 1 $1.00
Entry #2 category 2 $5.00
Entry #3 category 1 $7.00

I am trying to have the sub report show the summary of the category 1 instead of multiple times.

I.E.

(Main)
Project Acme
(Sub)
Entry #1&#3 category 1 $8.00
Entry #2 category 2 $5.00

Dont worry about the Entry field, I just put that there clarification.

Thanks.





 
Hi Matalgears,

I think that all you need to do is to create a group on you SubReport

Group by Category and place your fields on the group footer or header and then summarise the value by the group
and suppress the detail section.

Hope it helps

Mo
 
Hi MisterMo,

I did what you recommended.

I created a category group on the sub report and put the category field and the sum of the amounts in the group header suppress the details.

But when I ran the report, it still show the categories as separate. I think because the sub report treats each line item as different so the grouping doesn't work.



 
I am sure the grouping is working fine, there must be something else, have you got any other grouping on your subreport? eg. group by #Entry.

if so that must be removed for teh Group by Category to work.

I'd like to now more about the two fields used to link the main report to the subreport. are you displaying them as well?

where is the subreport placed within the main report?

Another option to eliminate the repeating category is to create another group by sequence number and/or detail number



Mo
 
I have no groupings on the subreport.

The two fields apply to both the project name and project category. I.E.

field 1 field 2 Project Name Project Category
100 1 Acme Category 1

The two fields are not displayed, only the Project Category.

The subreport is filtered via the two fields from the main report.

The subreport is placed in the details of the main.

Any help would be appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top