Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - [SOLVED] ColumnOrderChangedEx event
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] ColumnOrderChangedEx event

 Post Reply Post Reply
Author
Message
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] ColumnOrderChangedEx event
    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....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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.

};

Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 27 February 2009 at 12:31pm

Hi,

Well I have other values...

 

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....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 27 February 2009 at 2:55pm
1025 = 1024 + 1 === xtpReportColumnHidden | xtpReportColumnOrderChanged - this is i get running your test. It's right
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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))
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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?
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.234 seconds.