Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Another Group Sorting bug
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Another Group Sorting bug

 Post Reply Post Reply
Author
Message
vladjv View Drop Down
Newbie
Newbie


Joined: 22 January 2007
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote vladjv Quote  Post ReplyReply Direct Link To This Post Topic: Another Group Sorting bug
    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:
Originally posted by sserge sserge wrote:

Timo, It sorts groups by GroupPriority if exists, then by GroupCaption if exists, and after that it sorts rows by rows values. Could you please share your piece of code which doesn't work correctly? --WBR,Serge


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)

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 22 February 2007 at 3:19pm
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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.