?
Solved

Sorting On Subreport Data

Posted on 2006-11-17
6
Medium Priority
?
832 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 800 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 101

Expert Comment

by:mlmcc
ID: 17969277
What is your formula?

mlmcc
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying 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 1200 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 101

Expert Comment

by:mlmcc
ID: 18098067
Glad i could help

mlmcc
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

801 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