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
Solved

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

Posted on 2009-07-01
10
381 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
  • 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 34

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: 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: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 34

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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

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

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

829 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