Solved

Sorting On Subreport Data

Posted on 2006-11-17
6
830 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 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 101

Expert Comment

by:mlmcc
ID: 17969277
What is your formula?

mlmcc
0
On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

 

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 101

Expert Comment

by:mlmcc
ID: 18098067
Glad i could help

mlmcc
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

691 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