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!

Subreports out order

Status
Not open for further replies.

nathj

Programmer
Oct 11, 2004
33
GB
Hi there,

I am using Crystal reports 8.5 using data generated in VFP6.

I really hope someone can help me out here as this problem is driving me nuts. I have a crystal report file with 15 subreports each in its own details section. The last subreport and therefore last details section is the summary subreport. The problem is that this summary doesn't print in order. The report details a clients combined assets and say that client has property and unit trusts the report should show the property section, the unit trusts section and then the summary. However, and this is the bit that drives me mad, the report prints property, summary and unit trusts.

Can anyine maybe suggest any reason why this would happen.

Many thanks
Nathj
 
OK what order is it printing in then? Please give sample data and current output vs desired output.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
There are 15 subreports in 15 details sections; details a-o.

If the client on the report has property and unit trusts in their portfolio then it should display:
Property
Unit trusts
Summary

However it is displaying;
Property
Summary
Unit Trusts.

The subreports are only displayed if there is appropriate data to display and they are linked to the main report on asset ID, asset category and client number. Each subreport has its own data set which is linked to the main data set which is a list of clients and categories they have investments in.

If you need any further info let me know.;
thanks for helping out.
 
It looks like it is printing alphabetically, so what you need is the ability to use specified order. Can't tell what your groups are, but you would need to make your inner most group based on the category that has Property, Unit Trusts, and Summary as the results. Then use specified order to arrange the order as you like.

-LB
 
Thanks for this but I am not sure what you mean . The report sections are as follows
Group Header 1-a
Group Header 1-b
Group Header 1-c
and the grouping here is client #

details a - Cash
details b - Property
details c - Protection
details d - Pensions
details e - Bonds
details f - ISAs
details g - Unit trusts
detasil h - Gilts
details i - Equities
details j - Art
details k - Antiques
details l - Jewellery
details m - Cars
details n - SIPPs
details o - Summary

Each of these subreports (in the above order with the above names) have their own tables and they are linked on a combination of client number and asset ID. If the person on the report has property and Unit trusts the unit trust infomration is being displayed after the summary sub report. I have tried the suggestion of them being displayed in alphabetical order but changing the names has made no difference.

I am no crystal reports expert and didn't quite understand what you ment by specifying the subreport order.

Thanks for the help
NathJ
 
I should have said that in testoing the al;phabetic order I added a temporary subreport to a new details section; details p ZZZZZZ this then appeared:
Property (details b)
Summary (details o)
ZZZZZZ (details p)
Unit Trusts (details g)

Thanks very much
 
You can move existing subreports into a new section. Park one or two in the Report Footer while you shuffle the rest. Does that help?

Are you using shared variables? If so, that may cause problems, because values returned from a subreport are only useable in sections below the section that contains the subreport.

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

I'm not using any shared variables in this report. What would be the benefit of moving the subreports around? They are added to the report in the correct in order it is just that the report doesn't display them in the correct order.

Thanks
NathJ
 
They display in the section where they are placed. I assumed that this was the problem. Crystal will always display details b before details g and details o after both of them. Other software tools might give you a choice, but that's one of the limitations.

If that isn't the problem, please explain just what you are doing for the display.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
The problem is that it should display details b, g, o but infact it is displaying details b, o, g. this is the problemn that needs solving. I also added a dummy details p with a subreport named ZZZZZZ and this displayed as b, o, p, g. It seems that g always appears last.

I hope htat clears up the problem.

thanks for the help
 
Then the order probably corresponds to the Asset IDs. If you insert a group on Asset IDs, you can then use specified order and add the Asset IDs in the order that would result in the Summary section being last. You could place the subreports in group header or footer sections (still linked on both client and asset ID) and then suppress the detail section.

As a test, add the Asset Id to your detail section in the main report, to see if that is the driving order. If so, then follow my suggestion.

-LB
 
I have tested the report by ordering the data in the FoxPro tables in a number of ways and this makes no difference, for some reason Crystal wants to put details section g at the end no matter what. Are there some settings that I may not know of that could sort this out?

Cheers
NathJ
 
Wait a second. Are the detail lines distinct detail sections that you defined? Or did you just define one detail section, and that's your data?

If it is data, then do a formula field that derived a description from the data, making sure it is just from one specific record. Under [Reports], choose [Record Sort] and sort using that field.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Did you try placing the Asset ID in each detail section? The links will drive the order of the subreport display, I think. My guess is that the Asset ID will appear in ascending order down the detail sections.

-LB
 
Madawc,
Each subreport is in its own details section. There are 15 subreports and 15 details sections.

lbass,
The asset ID is in the data for each details section and that is used in the subreport linking along with the client id and asset category. However, the subreports are still appearing out of order.

I must say I really appreciate all the help everyone is offering.

Many thanks
NathJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top