Print Page | Close Window

Grouping/Sorting

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=980
Printed Date: 03 May 2024 at 1:30am


Topic: Grouping/Sorting
Posted By: redboan
Subject: Grouping/Sorting
Date Posted: 09 Jul 2007 at 10:37am
Hello All,

I am having an issue with grouping/sorting.  I have an Access Database, with about 70 records.  Of these 70 records, I have a field "category", that can have about 14 different "categories", and need to have all these records show.

However, when I select a category in the "select expert", after creating many groups, it only shows that one group.  It seems as if I change one of the groups to a different category, it changes them all.

Basically, I need to have a report that shows all these different groups, but separately.  I have tried using all subreports, but that will not work for my type of report.

Thanks,
Adrian



Replies:
Posted By: BrianBischof
Date Posted: 09 Jul 2007 at 10:52am
Sorry, but I'm not following what you are trying to do. You create multiple groups and then it only shows one of them (because the select expert filters them out?). Then you say if you change one of the groups it changes them all. Changes all the groups? In what way?

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: BrianBischof
Date Posted: 09 Jul 2007 at 10:52am
Oh yeah - if you want to display all groups, but separately then you can do page breaks after the group footer. Is that what you want?

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: jkwrpc
Date Posted: 09 Jul 2007 at 10:53am
Perhaps I am missing the point of what you are trying to do. If you want to group by category, you should be able to create a single group based on the category field. That will create a new group with appropriate details as each new catergory is read. The layout/design might look like this
--------------------
Group 1 {category field}
Detail
   {detail1} {detail2}
-------------------------------------
It should read like this when run
 
CategoryA
    Detail field1 info   Detail Field 2 info
 
CategoryB
    Detail field1 info   Detail Field 2 info
 
...and so on for the other 12 categories.
 
Hope this helps
 
Regards
 
John W.
http://www.CustomReportWriters.net - www.CustomReportWriters.net


Posted By: redboan
Date Posted: 09 Jul 2007 at 11:06am
Okay, I'll be a little more specific.

I have one table, with 70 records, in which I need separated by the 'category' field.  I have 14 different 'categories'.  In these categories, I have a field called 'finding', that we are numbering, and the numbers have to refresh in each category.

I guess I am not understanding how the 'group' function works (and I have the Crystal book, a little confusing for this section).  Do I need to create 14 different 'groups' for all of this data to show, or just one 'group'?  I have tried both, but when I do a preview, only the information for the last 'category' is shown, not all 14. 

I have created this 'grouping' in a subreport, as that is where my layout is for all of this information.

Thanks,
Adrian


Posted By: hilfy
Date Posted: 09 Jul 2007 at 11:30am
No, you create one group on the Category field.  This will then sort you data by category and you'll be able to do things like set up a running count of your finding field that resets to 0 every time the Category field changes.  It sounds like that is what you're trying to do.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: redboan
Date Posted: 09 Jul 2007 at 11:51am
Thanks, that did some of what I need to be done.  I also need a page break in between each category, and for the numbering scheme to start over in each category as well.

Any ideas?
Thanks,
Adrian


Posted By: hilfy
Date Posted: 09 Jul 2007 at 11:57am
In the select expert, on the group footer select "New Page After".  Click on the formula button next to it and enter "Not OnLastRecord" - this will prevent a final blank page.
 
When you set up a running count to use for your numbering, you can tell it to reset when the group changes.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: redboan
Date Posted: 09 Jul 2007 at 12:15pm
Awesome, that worked.

I have one other issue right now.  On each page, I also have a 'finding' field, which is followed by the crystal special field 'record number'.  On each new page (for each new category), I need to have that record number to reset to one.

Thanks,
Adrian


Posted By: hilfy
Date Posted: 09 Jul 2007 at 12:24pm
You can't use the Record Number.  You'll have to set up a running count.  Here's what you do:
 
1.  Create a new Running Total field
 
2.  In "Field To Summarize", select a field that is unique for each record.  In "Type of Summary", select "Distinct Count".  In "Reset" select "On Change of Group" and select your Category group.
 
3.  Put this field on your report instead of the Record Count.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window