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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sub-Report Missing Data 1

Status
Not open for further replies.

Dominican1979

IS-IT--Management
Apr 30, 2008
108
US
Hello everyone,

Thanks in advance for reading my post. So here is what I'm trying to do. I have a customs invoice that has two groups:

1 - Grouped by Country (coming from product order lines)
2 - Within the country grouped by manufacturer (also coming from the order lines)

There is a twist on the groups above, however, I created two formulas to actually do the groupings as follows:

@Country = if {Table.ProductGroup} = 12007 Then {Table.Country}
else "Japan"

@Manufacturer = if {Table.ProductGroup} = 12007 Then {Table.Manufacturer}
else "XYZ Manufacturer"

NOTE: Each record line has a field called "HCCode" which is used to report to customs what type of product is being shipped

I've tested these groupings and they work great as they're supposed to. Where I run into a problems is on my sub-report.

I created a sub report on the Group Footer for the @Country group, to summarize the quantities and amounts of products within each country.

The sub-report parameter field link I'm using is actually the @Country formula (also the main group on the main report) and I'm selecting the sub-report data based on the HCCode field (mentioned above)

In terms of the sub-report I have a group on HCCode. I'm placing the group name on the sub-report group footer where I'm also placing running total fields to summarize by country.

For example I have a running total field setup this way:

field to summarize: quantity
evaluate for: every record
reset on change of group: HCCode

When I run the report, I get no data on the sub-report.

I'm thinking the reason for this is because since I'm doing the formula groupings having the formula only looking at one product group and taking the actual value for the country from the database if the product group is matched and just changing the country to "Japan" for all others, then the HCCodes aren't being associated with this country since it's not coming directly from the database. That's just my theory.

I'm hoping someone could shed some light on how I can over come this, and still have Crystal summarize the data on the sub-report using the formula gropings along with the HCCode values that are coming from the database.


I'm using Crystal XI

Thanks!










 
What are you linking your {@Country} formula to? I think you should create the same formula in the subreport and then link the formulas to each other.

Also you don't really need running totals. You could just insert a sum on the quantity at the HCCode group level--if you don't have a group on this, make this group #2, with {@Country} being group #1.

-LB
 
Hi lbass,

Thanks a lot for your help. I created the same {@Country} formula on the subreport and linked them together and that did the trick. I didn't have to create a {@country} group on the subreport.
 
Hi lbass,

I think I spoke too soon. I had a limited data set using a HERE clause on the view that feeds my report in which I was only selecting one invoice. I have now removed that selection criteria and instead added a parameter field on my report.

Now my problem is that my sub-report selects all the HCCodes that have nothing to do with the invoice # I'm putting on the parameter. I created a group on {@Country} on the subreport and group # 2 on HCCode, and added the HCCode group name on the Group #2 footer.

Any idea why this may be happening? I thought once I had a parameter field, on the main report, the sub-report would only look at the data pulled on the main report. The information on the main report is all correct, the sub-report is all messed up.

Thank you so much for your help again.
 
I don't know what you mean. If you want the subreport to be based on invoices in the main report, then you need to link on invoice, too. Same goes for manufacturer.

-LB
 
Hi LB,

I added the invoice to the the subreport links and now i'm getting the correct info, thanks again for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top