Announcements
 Crystal Reports Forum : General Information : Announcements
Message Icon Topic: Grouping on a value returned from Subreport Post Reply Post New Topic
Author Message
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet Topic: Grouping on a value returned from Subreport
    Posted: 18 Dec 2007 at 4:42am
Hi
 
I am having a report which is grouped on customer no. i m having a subreport in the main report linked with customer no and document no  feild in main report. I m returing back a field "unit" from the subreport.
 
i m displaying the value of the field "unit"  returned by subreport on the  main report.
 
Now i want to group report on customer no and unit (returned from subreport) or else i would like to group on customer no and then sort it
on group name --> unit (returned from subreport).
 
But i am not able to see the "unit" feild in which i click the sort by option in menu. Even i tried  by assing the unit in a shared variable in subreport and trapping it in main report.
 
IS there anyway to do this ?Smile
 
Thanks
Savan
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 18 Dec 2007 at 5:37am
Unfortunately, probably not.  I think you are running up against the two-pass limit.  You may be out to pass four or five, actually, but that's beside the point.

One alternative may be to find some way to put the information you need back into the data source for the main report.  Does the data for the main report and the data for the subreport come from the same database?  One solution may be to add another join to your data source, joining to a simple aggregate query of the subreport's source.  For example:


SELECT Main.CustomerNo, Main.DocumentNo, Sub.UnitTotal
FROM Main
LEFT JOIN
    (SELECT CustomerNo, DocumentNo, SUM(Unit) AS UnitTotal
     FROM SubReportSourceTable
     GROUP BY CustomerNo, DocumentNo) Sub
ON Main.CustomerNo = Sub.CustomerNo
     AND Main.DocumentNo = Sub.DocumentNo


Does that help?

IP IP Logged
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet Posted: 18 Dec 2007 at 11:51pm
I dont have the option of using sql queries as i am getting the data from JD Edwards database and  and in crystal i am connecting through JD Edwards Enterprise one  drivers. There are two different tables used for the main report and sub report.
 
Confused anything else i can do?
Thanks
Savan
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 19 Dec 2007 at 6:55pm
I have not worked with the JD Edwards software. However, keep in mind that you can create SQL queries in Crystal Reports. You can add a Command object and place the query in it. If you have not tried this give it a go it might just work. In about 2 minutes you will know....
 
Regards,
 
John W.
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.047 seconds.