Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - [SOLVED] ACCVIO when calling ShowHeaderRows(FALSE)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] ACCVIO when calling ShowHeaderRows(FALSE)

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

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] ACCVIO when calling ShowHeaderRows(FALSE)
    Posted: 05 December 2011 at 10:59am
Hi;

I created the header records portion of a report control this way:
    Report_.GetHeaderRecords()->RemoveAll();

    CXTPReportRecord* Record=Report_.GetHeaderRecords()->Add(new CXTPReportRecord());

    for (int i=0; i<Report_.GetColumns()->GetCount(); i++) {
        if (i<13) {
            CXTPReportRecordItem* Item=Record->AddItem(new CXTPReportRecordItem());
            Item->SetEditable(FALSE);
        } else {
            CXTPReportRecordItem* Item=Record->AddItem(new CXTPReportRecordItemText());
            Item->SetEditable(TRUE);
        }
    }
   
    Report_.HeaderRowsAllowEdit(TRUE);
    Report_.HeaderRowsEnableSelection(FALSE);


The header row is used to define custom filtering conditions. When the user finished filtering I call this function:
void CCompoundReport::ClearFilter() {
   
    BeginWaitCursor();
   
    Report_.BeginUpdate();
   
    CXTPReportRecord* Record=Report_.GetHeaderRecords()->GetAt(0);
    for (int i=0; i<Report_.GetColumns()->GetCount(); i++) {
        CCompoundReportColumn* Column=reinterpret_cast<CCompoundReportColumn*>(Report_.GetColumns()->GetAt(i));
        if (Column->GetItemData()!=0) {
            CXTPReportRecordItemText* Item=DYNAMIC_DOWNCAST(CXTPReportRecordItemText, Record->GetItem(i));
            if (Item!=0)
                Item->SetValue(_T(""));
        }
    }

    for (int i=0; i<Report_.GetRecords()->GetCount(); i++) {
        Report_.GetRecords()->GetAt(i)->SetVisible(TRUE);
    }

   
    Report_.Populate();
    Report_.ShowHeaderRows(FALSE);
    Report_.EndUpdate();

    IsFiltered_=false;

    EndWaitCursor();
}


As soon as I call ShowHeaderRows(FALSE) I get the ACCVIO below. I tried to put the call elsewhere in code and it ALWAYS crashes. CXTPReportSection *pSection = pRow->GetSection(); in CXTPReportSections::EnsureVisible is a NULL pointer

Call stack:
ToolkitPro1513vc90UD.dll!CXTPReportRow::GetSection()  Zeile 814 + 0x3 Bytes    C++
     ToolkitPro1513vc90UD.dll!CXTPReportSections::EnsureVisible(CDC * pDC=0x0013df88, CXTPReportRow * pRow=0x00000000)  Zeile 86 + 0x8 Bytes    C++
     ToolkitPro1513vc90UD.dll!CXTPReportControl::EnsureVisible(CXTPReportRow * pRow=0x00000000)  Zeile 2031 + 0x23 Bytes    C++
     ToolkitPro1513vc90UD.dll!CXTPReportControl::SetFocusedRow(int bEnsureVisible=0x00000001, CXTPReportRow * pRow=0x00000000, int bShiftKey=0x00000000, int bControlKey=0x00000000)  Zeile 1944    C++
     ToolkitPro1513vc90UD.dll!CXTPReportControl::SetFocusedRow(CXTPReportRow * pRow=0x00000000, int bControlKey=0x00000000)  Zeile 1768    C++
     ToolkitPro1513vc90UD.dll!CXTPReportNavigator::MoveFirstVisibleRow(XTPReportRowType TargetType=xtpRowTypeBody)  Zeile 532    C++
     ToolkitPro1513vc90UD.dll!CXTPReportNavigator::SetCurrentFocusInHeadersRows(int bCurrentFocusInHeadersRows=0x00000000)  Zeile 483    C++
>    ToolkitPro1513vc90UD.dll!CXTPReportControl::ShowHeaderRows(int bShow=0x00000000)  Zeile 139    C++
     XRMiniLIMS.exe!CCompoundReport::ClearFilter()  Zeile 855 + 0x13 Bytes    C++
     XRMiniLIMS.exe!CReportingWnd::ClearFilter()  Zeile 230    C++
     XRMiniLIMS.exe!CMiniLIMSFrameWnd::OnReportingClearFilter()  Zeile 2184    C++


How can I fix this?
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 05 December 2011 at 7:48pm
This should already be fixed for the next release.

Codejock support
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.172 seconds.