Solved

Sorting On Subreport Data

Posted on 2006-11-17
6
821 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now