Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Sorting based on data from a subreport parameter Post Reply Post New Topic
Author Message
carstowal
Groupie
Groupie


Joined: 31 Jul 2008
Online Status: Offline
Posts: 80
Quote carstowal Replybullet Topic: Sorting based on data from a subreport parameter
     Posted: 25 Apr 2012 at 9:45am
I can't believe this is possible with the way Crystal works, but thought I'd ask just in case.

I have a subreport looking at paid invoices in the past 90 days, which returns the average number of days between invoice and receipt of payment by customer.  @DaysToRecpt (Shared NumberVar DaysToRecpt)

The main report lists all unpaid invoices, grouped by Customer and sorted by invoice date ascending. (with the Group Hdr hidden)

I've brought the Shared NumberVar DaysToRecpt into the Group1 Hdr.
My @ExpectdRecptDate uses Select Case to return the Friday following {RECEIVABLE.INVOICE_DATE} + {@DaysToRecpt}

WHAT I REALLY WANT THE REPORT TO DO IS:
Group on the @ExpectdRecptDate so I can subtotal the anticipated receipts weekly.  But how to do this when the  Shared NumberVar DaysToRecpt comes from a subreport?????


I don't really care who the customer is for grouping purposes, I just grouped on the customer so I could return the Shared NumberVar DaysToRecpt

Right now I'm exporting my CR to Excel and running a macro to subtotal anticipated receipts weekly.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Apr 2012 at 4:04am

To my knowledge it is not possible to sort a main report based on anything that comes from a subreport nor can you use a grouping to get a summary value and then ignore that group to regroup in another fashion for display. In general a stored proc (or command object) could get that data in the original data set, not requiring the use of subreports) which you could then use to sort and group as you desired.

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