Solved

Crystal Reporting XI - how to have Sort "override" Grouping

Posted on 2009-07-01
10
386 Views
Last Modified: 2012-05-07
I have a report that is grouped by Job Number.

The report only display header type of data for each Job Number so I don't need to do any sorting of records within the group since there is only header type data.

What I need to do is have the overall report sort by a field within this header data that happens to be a Date field. This Date field is displayed in the group footer.

Is this possible?  When I go into Sort Expert, it has my Job Number grouping as the primary sort and will not let me put this Date field above it to be the primary sort??

thanks

0
Comment
Question by:JMO9966
[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
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 5

Accepted Solution

by:
jgbreeden earned 100 total points
ID: 24756190
Why do you have it grouped on Job Number, are there child records or just multiple occurrences of each job in the main table?  If it is a child table, you could use a sub report & pass the job number to the sub, then remove the grouping in the main report.  If it is multiple records in the main table, I don't think you can override the grouping in the sort.
0
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 300 total points
ID: 24759487
When you group a report, Crystal automatically makes that the first sort for the report.  That is how it groups the records.

You can then add secondary sorts.

It is possible to sort the groups by another field through the GROUP SORT EXPERT>  You must have a summary function on the field you want to use.  For instance on your report if the last record in a group has the max date you could add a summary Maximum({DateField}) then use the GROUP SORT EXPERT (under the REPORT menu) to sort the groups on the max date.

mlmcc
0
 
LVL 35

Assisted Solution

by:James0628
James0628 earned 100 total points
ID: 24769197
If you simply want to sort by another field before a group, simply create a group on that field.  Suppress the new group header and footer and you've essentially sorted the original group(s) by the new field.  Note that if this is a date/datetime field, CR will default to grouping "for each week".  If you want the report grouped (sorted) by each day, you'll need to go into the group options and change that setting.

 James
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

 

Author Comment

by:JMO9966
ID: 24814569
Go thoughts guys, but let me add more details.

I have a summary in my group footer (grouping=by Job Number) that tells me the maximum value for the left join table.  The summary field tells me the max sequence (integer) in this table for that particular job number.  I then use this formula to display the date for the max sequence row.

If {Job_Op.Sequence}={@Max_sequence} Then
{Job_Op.Sched_End}

Keep in mind, the max sequence may not necessarily have the max date value, that's why I had to go this route since I really need the date for the max sequence not necessarily the max date.

I attempt to do a grouping on this formula field, but it does not appear in my list as objects I can group by, most likely because the formula is based on a summary field.

Please give me your thoughts. I'm increasing points to 500 now.
0
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 300 total points
ID: 24815034
I don't think you will be able to group on that formua.

What is the @Max_Sequence formula?

mlmcc
0
 

Author Comment

by:JMO9966
ID: 24815229
Maximum ({Job_Operation_2.Sequence}, {OP_ActiveJobs_TTX.Job})

Is it true that you cannot group or sort by summary fields??

Any clever workaround without re-doing the entire report would be good.

thanks
0
 

Author Comment

by:JMO9966
ID: 24815236
Sorry,

Maximum ({Job_Op.Sequence}, {OP_ActiveJobs_TTX.Job})
0
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 300 total points
ID: 24815313
Maximum is a PrintTime formula and it isn't calculated until the grouping is done.  

There is probably a way around this issue but it will involve using subreports.

Does your report have a subreport already?

mlmcc
0
 

Author Closing Comment

by:JMO9966
ID: 31598833
Thanks guys,

I added a grouping for a Date field in a Left Join table and changed the setting to Daily and moved this grouping above Job grouping and suppressed the new grouping and it looks good!
0
 
LVL 35

Expert Comment

by:James0628
ID: 24856616
I'm glad that worked out for you.  I couldn't see any way to get the Maximum thing to work.

 James
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 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