Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grouping and Sorting by different Fields CR VS2005 1

Status
Not open for further replies.

treinsberg

Programmer
Aug 11, 2008
6
DE
Hello Community

I had a little problem with CystalReports. Im using the buildin CR in VisualStudio 2005. My Data look like this:

Field1 Field2 Field3
2 fff 12
5 aaa 25
3 bbb 23
1 xxx 65
4 hhh 89
1 xxx 6

The generated Report should by Grouped By Field1. The Group is no Problem this works fine. Sorting by Groupingfield also works fine. My Problem is now that that the Group should by Grouped by Field1 and sorted by Filed2. Is there any chance to do this?

Thomas
 
Sorted by field2 within the group? Or you literally want field1=5 to be first because alphabetically "aaa" is first, and likewise field1=1 and "xxx" would be your last group?

hat if you have multiple values of field2 for a single value of field 1? Is that not possible?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Yes i want to sort by Field2 within the group. Result should look like this:
5 aaa Sum(Field3)
3 bbb Sum(Field3)
2 fff Sum(Field3)
4 hhh Sum(Field3)
1 xxx Sum(Field3)

multiple Values for Filed2 for a single Value of Field1 are not possible.

Thanks for answers






 
In crystal report designer, go to report, record sort expert. You group field should already be there, so just add the additional field.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
So this may makes a sorting for the data section under the group. But I don´t show any data section. Only the Groupheader is visible. And the Groupheader should be sorted by Field2 and Grouped by Field1.
 
In the detail section, insert a maximum on field2 at the group (field1) level. Then go to report->group sort and select maximum of field2 as your group sort field.

-LB
 
Thanks a lot. The last tip nearly gets the problem. But I only can´t create the maximum field in the detailed section. The field had to be generated in the groupheader or groupfooter.
 
Place field2 in the detail section and then insert a maximum on it. Then go to group sort. Or are you now saying that field2 is already a summary? If so, please explain.

-LB
 
So my DetailSection is Empty. Only the GroupHeader is shown like my Example.
So the Result should look like this:

5 aaa Sum(Field3) --> GroupHeader
3 bbb Sum(Field3) --> GroupHeader
2 fff Sum(Field3) --> GroupHeader
4 hhh Sum(Field3) --> GroupHeader
1 xxx Sum(Field3) --> GroupHeader

No DetailSection is used becaus multiple Field1, Field2 Entrys should be grouped. When you say "insert a maximum on it" this means Insert a group result?
 
Place field2 in the detail section and insert a maximum on it at the group level. You don't have to display the detail section or the maximum result. This is what you need to do to activate the group sort feature. Please try it.

-LB
 
Ok thanks a lot for help. Now all works fine. I placed a maximum on field2 in the group header and dont´n display it. Now sorting is activated. But I don´t have to place field2 at detail section to do the maximum.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top