Print Page | Close Window

[SOLVED] ColumnOrderChangedEx event

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=13464
Printed Date: 14 November 2024 at 9:42pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED] ColumnOrderChangedEx event
Posted By: Aaron
Subject: [SOLVED] ColumnOrderChangedEx event
Date Posted: 21 February 2009 at 2:41pm
Hi,
 
Reason in ColumnOrderChangedEx event returns incorrect values.
 
for example:
 
xtpReportColumnHidden = 1025  (should be 1024)
xtpReportColumnShown = 513    (should be 512)
 
Looks like:
 
0 <> 2048         +1
2049 <> 4096   +2
.............................
 
 
Please look into it
 
 
Thanks


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....



Replies:
Posted By: mdoubson
Date Posted: 26 February 2009 at 4:14pm

enum XTPReportColumnOrderChangedReason

{

xtpReportColumnChangeOther = 0x0000, // Neither column order nor group order is changed.

xtpReportColumnOrderChanged = 0x0001, // Column order changed.

xtpReportColumnGroupOrderChanged = 0x0002, // Group order changed.

xtpReportColumnOrderChangedMask = 0x000F, // A mask for order change flags.

xtpReportColumnAdded = 0x0010, // A column is added to the column list.

xtpReportColumnRemoved = 0x0020, // A column is removed from the column list.

xtpReportColumnPropExchange = 0x0040, // The column properties changed during properties exchange procedure.

xtpReportColumnCaptionChanged = 0x0080, // The column caption is changed.

xtpReportColumnWidthChanged = 0x0100, // The column width is changed.

xtpReportColumnShown = 0x0200, // A column visibility property is changed to "visible".

xtpReportColumnHidden = 0x0400, // A column visibility property is changed to "hidden".

xtpReportColumnMoved = 0x0800, // A column is moved.

xtpReportColumnAddedToGroupby = 0x1000, // A column is added to the GroupBy box.

xtpReportColumnRemovedFromGroupby = 0x2000, // A column is removed from the GroupBy box.

xtpReportColumnAddedToFieldChooser = 0x4000, // A column is added to the Field Chooser.

xtpReportColumnRemovedFromFieldChooser = 0x8000, // A column is removed from the Field Chooser.

xtpReportColumnChangeMask = 0xFFF0, // A mask for column change flags.

};



-------------
Mark Doubson, Ph.D.


Posted By: Aaron
Date Posted: 27 February 2009 at 12:31pm

Hi,

Well I have other values...

 

https://forum.codejock.com/uploads/20090227_123044_TestColumnOrder.zip - uploads/20090227_123044_TestColumnOrder.zip

 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: mdoubson
Date Posted: 27 February 2009 at 2:55pm
1025 = 1024 + 1 === xtpReportColumnHidden | xtpReportColumnOrderChanged - this is i get running your test. It's right

-------------
Mark Doubson, Ph.D.


Posted By: Aaron
Date Posted: 27 February 2009 at 4:50pm
Hi,
 
OK, but then I have another question for you:
 
Just remove one column (drag column from header) and you get two events:
 
  1. xtpReportColumnHidden + xtpReportColumnOrderChanged = 1025
  2. xtpReportColumnOrderChanged = 1
Strange, right?
 
 
Thanks
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: mdoubson
Date Posted: 27 February 2009 at 5:17pm
Right - too many notifications.
btw - easy to test with code
        Set recItem = rec.AddItem("Caption: " & Column.Caption & " - " & "Reason: " & Hex$(Reason))


-------------
Mark Doubson, Ph.D.


Posted By: Aaron
Date Posted: 28 February 2009 at 3:23am
Hi,
 
Also groupbox notifications will be thrown in ColumnOrderChangedEx. If you would use both events (ColumnOrderChangedEx and GroupOrderChangedEx) you get 2 notifications of same event. 
 
To test:
  1. Add GroupOrderChangedEx event.
  2. Copy code from ColumnOrderChangedEx event.
  3. Drag column to groupbox.
  4. Now you see two events of same type but one in ColumnOrderChangedEx and other one in GroupOrderChangedEx event 

Thank you



-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: mdoubson
Date Posted: 28 February 2009 at 5:26am

You need to decode the received notification - group-related have own ids so it is easy to recognize:

xtpReportColumnAddedToGroupby = 0x1000, // A column is added to the GroupBy box.

xtpReportColumnRemovedFromGroupby = 0x2000, // A column is removed from the GroupBy box.

btw - you had 2 events in your posted case:

   1st - column hide in table and columns order changed as result
   2nd - column add in group row and group row order changed as result


-------------
Mark Doubson, Ph.D.


Posted By: Aaron
Date Posted: 01 March 2009 at 5:07am
Hi Mark,
 
That's what I said. Why is Groupbox notification in ColumnChangedEx event. The GroupOrderChangedEx event covers this already, now you have same event TWICE
 
This post is just a remark on these events and how they are implemented. Leave it for now... You can't change it anymore so why bother...
 
Thanks
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: mdoubson
Date Posted: 01 March 2009 at 11:58pm
Cause GroupBox deals with columns and columns order.
There are two events here - one on GroupBox, one - on Header columns set.
You can use or not this notificaction. This is logical. Why should I change?


-------------
Mark Doubson, Ph.D.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net