Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: sorting random rows Post Reply Post New Topic
Author Message
gerrym730
Newbie
Newbie


Joined: 14 Dec 2009
Location: Canada
Online Status: Offline
Posts: 1
Quote gerrym730 Replybullet Topic: sorting random rows
    Posted: 14 Dec 2009 at 1:49pm
INFO:
Rows are assigned a random number and selected via percentage of total row count.

The data is sorted by a random number, so I suppress the rows I do not want displayed. Sample below

Name                 Random Number     
=====               ============
John                         .01
 
Chris                        .24

George                     .34


... etc , ... , etc


Question:
After i have my data set selected and ordered,  how I do display the data in Name order?  Use an array and resort the data for display purposes (suppress display of first detail group and put in a second detail group)?


Thanks for any assistance






IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 15 Dec 2009 at 6:56am
Just to make sure that I have this correct, you sort the data so that you can suppress rows based on the random number.  Once the rows are suppressed you want to display the report in name order.
 
I guess my first question is how are you getting the data?  Since this is an application, I would think that you have access to the db and can create a stored proc, which is by far the easiest method to get data for a report.  In the stored proc, I would delete/omit the rows that would be suppressed, then just build the report based on Name.
 
Here's the problem, if you have a group that is based on the random number, and that is your highest group, then regardless of what grouping you add, it will first be sorted by the random number, so any subgroup would be for people with the same random number (which is unlikely).  If you can filter the data without the grouping, say in the reports/selection formula/records, then your grouping can be on the name.
 
Hopefully you can see how CR is applying the grouping, because once you can understand that, you can figure out how to make CR do what you want...or see why it can't be done.
 
HTH
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.