Another Group Sorting bug |
Post Reply |
Author | |
vladjv
Newbie Joined: 22 January 2007 Status: Offline Points: 3 |
Post Options
Thanks(0)
Posted: 20 February 2007 at 9:55am |
Hello!
Version: "Xtreme SuitePro ActiveX v10.4.1" Codejock.ReportControl.ocx 10.4.1.0 Example project: "Xtreme SuitePro ActiveX v10.4.1\samples\ReportControl\C#.NET\ReportSample\ReportSample.sln" I hase made folowing changes: 1) file: frmMain.cs" function: private void frmMain_Load(object sender, System.EventArgs e) //adding to RC only 3 records AddRecord(Constants.IMPORTANCE_HIGH, false, false, "postmaster@mail.codejock.com", Subject, Sent, 7, true, 5, Received, Created, Subject, EmptyString, Msg, EmptyString, EmptyString, EmptyString, EmptyString, EmptyString, Msg); Msg = "Breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the lpRect parameter. A carriage return-linefeed sequence also breaks the line."; Subject = "Hi Mary Jane"; AddRecord(Constants.IMPORTANCE_NORMAL, false, false, "Peter Parker", "RE: " + Subject, Sent, 14, false, 4.3, Received, Created, Subject, EmptyString, Msg, EmptyString, EmptyString, EmptyString, EmptyString, EmptyString, Msg); Subject = ""; Msg = "If you have several conditions to be tested together, and you know that one is more likely to pass or fail than the others, you can use a feature called 'short circuit evaluation' to speed the execution of your script. When JScript evaluates a logical expression, it only evaluates as many sub-expressions as required to get a result."; AddRecord(Constants.IMPORTANCE_NORMAL, true, false, "postmaster@mail.codejock.com", "RE:" + Subject, Sent, 24, false, 56, Received, Created, Subject, EmptyString, Msg, EmptyString, EmptyString, EmptyString, EmptyString, EmptyString, Msg); 2) file: frmMain.cs function: private void frmMain_Load(object sender, System.EventArgs e) for(int i=0; i<wndReportControl.Records.Count; i++ ) wndReportControl.Records[ID.COLUMN_FROM].SortPriority=i; note: RC grouped by COLUMN_FROM. Based on this:
there are should be 2 groups: "postmaster@mail.codejock.com" (2 records) "Peter Parker" (1 record) But indeed report control shows 3 groups! "postmaster@mail.codejock.com" (1 record) "Peter Parker" (1 record) "postmaster@mail.codejock.com" (1 record) |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Below are more details about sorting and grouping.
To group rows Report control sorts them firstly. Then it creates groups for such sorted rows. Groups are created for rows with identical group keys. It checks rows one by one from begin to end. To sort rows group keys are used firstly, then sort keys are used. I mean if you select group by a "From" column and sort by a "Subject" column -- items will be compared by "From" column firstly and in case of identical ones they will be compared by "Subject" column. When comparing by GroupOrder -- GroupPriority is used if specified, otherwise - caption or value. When comparing by SortOrder -- SortPriority is used if specified, otherwise - caption or value. See the picture below: And regarding your sample. Records were sorted using SortPriority and grouped according their sorting. GroupPriority and SortPriority are used to separate sorting and groping keys. -- WBR, Serge |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions 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 |