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

[SOLVED] Collapsing Group Programmatically Crashes

 Post Reply Post Reply
Author
Message
Peter Bragg View Drop Down
Newbie
Newbie


Joined: 26 November 2014
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Peter Bragg Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] Collapsing Group Programmatically Crashes
    Posted: 14 January 2015 at 11:34am
Are there any known issues with the Com ActiveX ReportControl version 16.3.1 and programmatically collapsing groups? Or rather, groups with Records that themselves have children?

I am using v16.3.1 with DataFlex and the control keeps causing my application to crash. The following is test code but demonstrates the problem:

Procedure OnClick
    Variant vRow
    Handle  hoRow hoGroup
    Boolean bIsGroup bExpanded
    
    Get ComFocusedRow of oReportControl to vRow
    Get Create (RefClass(cCJReportRow)) to hoRow
    Set pvComObject of hoRow to vRow
    Get ComGroupRow of hoRow to bIsGroup
    If (bIsGroup) Begin
        Get Create (RefClass(cCJReportGroupRow)) to hoGroup
        Set pvComObject of hoGroup to vRow
        Get ComExpanded of hoGroup to bExpanded
        Set ComExpanded of hoGroup to (not(bExpanded))
        Send Destroy of hoGroup
    End
    Send Destroy of hoRow
End_Procedure

(This is test code by the way, so I know that the FocusedRow will always return a value)

The test code simply expands or collapses a group row, depending on its current state (if collapsed it will expand it and vice versa)

So, if the group row is collapsed, no problem, it gets expanded. If it is expanded though it then depends on the rows. If the rows have no child rows then the group collapses with no issues. But if just one of the rows within the group has child rows of its own (the first column has the TreeColumn property set to True) then the application crashes.

I can see from the release notes for 16.2.5 for the ReportControl that one of the fixes was "Fixed crash when manually expanding/collapsing a row via code" - which is what caused me to wonder if there was still an issue in this area?


Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 23 April 2015 at 7:02am
fixed in revision 16822  (January 20, 2015) due to support ticket 33444  "Report Control - Expand property" (crash in ActiveX on multilevel nesting rows).

in file XTPReportSection.cpp
int CXTPReportSection::_DoCollapse(CXTPReportRow *pRow)
{
int nIndex = pRow->GetIndex() + 1;
if (nIndex == 0) // pRow->GetIndex() == -1
return 0; // pRow already collapsed
...
}
...
void CXTPReportSection::RefreshIndexes(int nIndexStart)
{
int nRowCount = m_pRows->GetCount();
nIndexStart = nIndexStart < 0 ? 0 : nIndexStart;
...
}
 
 
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.