Solved

Sorting On Subreport Data

Posted on 2006-11-17
6
826 Views
Last Modified: 2008-02-01
I would like to sort by subreport data.  I have passed a date back from my subreport to my main report using a shared datevar, and put it in a formula.  But Cyrstal doesn't show that formula in my sort expert.  I am using Crystal XI.  Is there a way to sort on information from a subreport?
0
Comment
Question by:AptDev
  • 3
  • 2
6 Comments
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 200 total points
ID: 17969163
Where is the subreport?  Which section?

I don't know if you can do it or not since I believe the sorting and grouping is done before subreports are run.

mlmcc
0
 

Author Comment

by:AptDev
ID: 17969221
The subreport is in the details section.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 17969277
What is your formula?

mlmcc
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

Author Comment

by:AptDev
ID: 17969344
Thanks mlmcc... in the subreport I have created two formulas.  

The resetter formula goes in the group header, and it goes like this:

Shared DateVar SortDate := date('01/01/1947');


Then in the detail section of the subreport, I have the max date finder formula like this:

Shared DateVar SortDate;
  if {operation.trans_date} > SortDate then
    SortDate :=  {operation.trans_date};


Then in the main report I have created a formula called Sort_Date that looks like this:

Shared DateVar SortDate;
  SortDate;


The date seems to be passing back and forth in the formulas just fine, it's just that I can't seem to get the sort wizard to recognize or even see the formula to allow me to sort on it.

From the look of things, I'll probably have to rewrite the report without the subreport.  I was just hoping somebody had run into this before and knew a trick I haven't learned yet.
0
 
LVL 26

Accepted Solution

by:
Kurt Reinhardt earned 300 total points
ID: 17975959
1)  Having a subreport in the detail section is a bad idea from a performance perspective. This is because at least one subreport instance will be created and passed as a query to the database for every occurrence of a detail record.  If you have 100 records, you'll have at least 100 subreport queries sent to the DB over your network.  If you have 5K detail records, etc...  There's almost always a better design solution.

2)  You can't sort on a subreport field that's been passed back from the subreport into the main report.

3)  If you're using a SQL-based databaes (SQL Server, Oracle, etc...), then you can create a SQL Expression field in the primary report that returns the date otherwise returned by the subreport.

Are you using a SQL-based DB?

~Kurt
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 18098067
Glad i could help

mlmcc
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question