Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: sort based on subreport Post Reply Post New Topic
Author Message
jbalbo
Senior Member
Senior Member
Avatar

Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Quote jbalbo Replybullet Topic: sort based on subreport
     Posted: 14 Jul 2011 at 4:45am

Hi,

 
Is there a way to sort the main report on a field on the subreport?
 
Thx
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Jul 2011 at 5:04am
pretty sure that it is no because the data that could be returned from a sr to the mr is in a shared variable which does not exist in teh mr until after the sort passes have already run
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 15 Jul 2011 at 5:23am
if you join to the table in the subreport you could.
 
or (and DBlank knows what coming)
 
use a stored proc, then you could include the value from the subreport in the data and then you can sort on it.
 
Otherwise, I agree with DBlank, you can't sort on the subreport, as it has not been run at the time that CR is grouping and sorting the data.
 
HTH
IP IP Logged
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