Solved

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

Posted on 2009-07-01
10
373 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
 

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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

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. …
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

760 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

22 Experts available now in Live!

Get 1:1 Help Now