Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Subreport Post Reply Post New Topic
Page  of 2 Next >>
Author Message
vijayk
Groupie
Groupie


Joined: 14 Mar 2007
Location: United States
Online Status: Offline
Posts: 53
Quote vijayk Replybullet Topic: Subreport
     Posted: 28 Mar 2008 at 9:44am

I have a scenario where I have to display the detail records  for each division and at the bottom of each division I have to group the records & display them by account no’s.

 

So I created a Group on Division and created a subreport in the group footer which has summarized data by acct no.

 

The results are ok. But the only issue is user can run this for several divisions at a time and Sub report should display data only corresponding to that division.

 

So I tried creating linked sub report and I linked on Division No but Sub report still displays data for all the divisions under first division rather than on its own divisions.

 

Can anyone know what I am doing wrong.?

 

Thanks

Vijay

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 28 Mar 2008 at 9:46am

Check the Select Expert in the subreport.  Is your linking field in there?  Do you have any other criteria set in the Select Expert that could be causing this type of problem?

-Dell
IP IP Logged
vijayk
Groupie
Groupie


Joined: 14 Mar 2007
Location: United States
Online Status: Offline
Posts: 53
Quote vijayk Replybullet Posted: 28 Mar 2008 at 10:56am
Can i just have the division in the record selection for sub report or can i have additional conditions.?
 
I do have addition criteria like year, period, week etc.
 
Thanks
Vijay
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 28 Mar 2008 at 12:19pm
Just to throw out a different idea. Perhaps you could eliminate the subreport and create another group for account numbers.  Your report layout would look something like this:
 
Grp 1 Division
Grp2 Account Number
 
You could create selection statements for two command objects containing the appropriate data for each group and use the division number to relate the two command objects in the database expert - linking tab.
 
You could then suppress any header, detail or footer sections not needed for the report.
 
It becomes quite simple from that point to create and use your selection criteria.
 
Regards,
 
John W.
 
 
 
IP IP Logged
vijayk
Groupie
Groupie


Joined: 14 Mar 2007
Location: United States
Online Status: Offline
Posts: 53
Quote vijayk Replybullet Posted: 28 Mar 2008 at 12:29pm
I did try that but I cannot get the format of the report they are expecting.
 
Thanks
Vijay
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 29 Mar 2008 at 9:25am
Just curious ... what in the required format keeps this from working?  Perhaps there is a solution to that problem someone can recommend.
 
It should be no secret I am not the biggest fan of subreports, although I do use them.  However, if the data is related I can often avoid them. Since it sounds like your data is related perhaps this (grouping) can still work.
 
Regardless, I am sure someone on this forum will help you find the solution you need. 
 
Regards,
 
John W.
IP IP Logged
vijayk
Groupie
Groupie


Joined: 14 Mar 2007
Location: United States
Online Status: Offline
Posts: 53
Quote vijayk Replybullet Posted: 31 Mar 2008 at 7:02am
Format i am looking is
 
It will show the details.
 
Divison
 
Acctno.. Div.. jornal ety no.. Amount.
1111      011     00002         1000$
1222      011     00004          2000$
 
After the details .. At the end of each division, I need to show the summary by Journal ety no.
 
Division
 
Journal Ety No  Amount
0002               1000$
0003               2000$
 
Can we acheive the above format without a subreport.?
 
Thanks
Vijay
 
 
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 31 Mar 2008 at 9:10am

See if something like this may work (though it probably needs some refinement); you should be able to try it in under 5 – 10 minutes.

 ---------------------------------------------

Group 1

Group 1 Header Division  ( in the example -  011)

Group 1 Details Suppress

Group 2  

            Group 2  Header ( Place Column Label

account number, Journal Ety No.  Amount

Group 2 Details (DataFields)

Group 2 Footer ( suppress)

Group 3

Group 3 Header Column Labels

                        Journal Ety No. Amount

Group 3 Details ( If summary information needs suppress details but put data

            fields into it).

Group 3 Footer ( If summary information needed  create Summary on group 3 amount column and show in footer,  Also repeat datafield for Journal Ety No.

-------------------------------------------------------------------------
You should do as much of the grouping as possible on the database side of things, that is in your SELECT statements.
 
Hope this will be of some help.
 
Regards,
 
John W.
 
 
 
           
IP IP Logged
vijayk
Groupie
Groupie


Joined: 14 Mar 2007
Location: United States
Online Status: Offline
Posts: 53
Quote vijayk Replybullet Posted: 01 Apr 2008 at 12:29pm
You can have only one details section for all group headers. ? Are these like subreports or you are saying you can have multiple details in one report.?
 
Thanks
Vijay
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 01 Apr 2008 at 1:31pm

In one sense you are correct, there is only one place for detail sections, but you can have multiple sections. They end up being labeled Detail a , Details b, etc.

 

Since I threw this together in a hurry let me see if I can offer a way for you to layout the report. Since I don’t have data I cannot troubleshoot the problem

 

Group 1 Header   Group by Division - DivisionDataField

Group 2 Header  Group by Account Number  - then layout Column Labels

Group 2 Details   datafields

Group 2 Footer   (suppress)

Group 3 Header Group by Journal Ety No. (suppress)

Group 3 Footer Column Labels under the column labels place the datafields from Command Object containing data for the footer.

 

If you need total amounts for Group 3 create an SELECT Statement that sums the  amount and groups by Division, Journal Ety No.

 

Then link ( Use the DataBase Expert – linking tab) the command objects Command Object 1 which should hold the Group 1 and 2 data with the Group 3 data. I am guessing Division should be the linking fields since it is the main group. The type of join can impact the data returned, you will need to use the appropriate type.

 

This will keep you in the confines of a single detail section. There is probably a way to do it with multiple detail sections but this should be simpler.

 

What this gives you, assuming it works, is improved performance over a design that uses a subreport. Also it cleans up the ability to pass in parameters, your report selection parameters.

 

Hope this helps, again this is a quick response so you may have to work with it and others on the forum can correct any errors in what I have suggested. 

 

 

Regards,

 

John W.

IP IP Logged
Page  of 2 Next >>
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum