Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - [SOLVED] Crash bug in 13.2
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] Crash bug in 13.2

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

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] Crash bug in 13.2
    Posted: 24 October 2009 at 11:53am

Unfortunately, SetLastColumnExpand is too buggy in its current state.

1) When there are no columns in a report control, the function crashes at XTPReportHeader.cpp(2044).
GetLastVisibleColumn() returns NULL:
m_pColumns->GetLastVisibleColumn()->SetAutoSize(TRUE);
 
2) When the control is resized, the report rows are not updated. It seems the GUI is never refreshed after this operation.
 
3) There is no descriptive comment for this function in the header file.
 
 
#2 is absolutely crucial, so I'll wait till next version :(
 
 
Tried your sample again, and got the same error as described:
 
 
It seems you don't handle scrolling properly...
PokerMemento - http://www.pokermemento.com/
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 October 2009 at 6:32pm
Try for now call this function after checking
if (GetReportCtrl().GetColumns()->GetLastVisibleColumn() != NULL) ....
I will put this check inside the code.
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 October 2009 at 6:48pm
Check new demo in your prev. post https://forum.codejock.com/forum_posts.asp?TID=15075 where I put a link to my new prototype with special last column mode - looks similar to your task
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 October 2009 at 7:52pm
this is my code for ReportPaneView demo app - it properly do column sizing and use last column for external (form) resizing:

void CReportPaneViewView::OnInitialUpdate() {

CXTPReportView::OnInitialUpdate();

CString columnStr;

for (int i = 0; i < COL_NUMBER; i++) {

columnStr.Format("Column %d",i);

CXTPReportColumn* pCol = GetReportCtrl().AddColumn(new CXTPReportColumn(i, columnStr, 60, FALSE,XTP_REPORT_NOICON,TRUE));

pCol->EnableResize(TRUE); }

for (int j = 0; j < ROW_NUMBER; j++)  GetReportCtrl().AddRecord(new CReportViewRecord(j));

GetReportCtrl().Populate();

GetReportCtrl().GetReportHeader()->SetAutoColumnSizing(FALSE);

GetReportCtrl().GetPaintManager()->SetColumnStyle(xtpReportColumnOffice2007);

GetReportCtrl().GetPaintManager()->SetDrawGridForEmptySpace(TRUE);

GetReportCtrl().GetPaintManager()->SetGridStyle(0, xtpReportGridSolid);

GetReportCtrl().GetPaintManager()->SetGridStyle(1, xtpReportGridSolid);

GetReportCtrl().GetPaintManager()->SetHeaderRowsDividerStyle(xtpReportFixedRowsDividerBold);

GetReportCtrl().GetPaintManager()->SetFooterRowsDividerStyle(xtpReportFixedRowsDividerBold);

GetReportCtrl().GetPaintManager()->m_clrHeaderRowsDivider = RGB(255,0,0);

GetReportCtrl().GetPaintManager()->m_clrFooterRowsDivider = RGB(0,0,255);

GetReportCtrl().AssignIconViewPropNumAndIconNum(-1, -1, TRUE, 20);

GetReportCtrl().GetPaintManager()->SetLastColumnWidthWYSIWYG(TRUE);

GetReportCtrl().GetPaintManager()->SetColumnWidthWYSIWYG(TRUE);

m_pPrintOptions->GetPageHeader()->m_strFormatString = "Header text: &p from &P";

m_pPrintOptions->GetPageFooter()->m_strFormatString = "Footer text: &D";

GetReportCtrl().m_bForcePagination = TRUE;

GetReportCtrl().AllowEdit(TRUE);

//GetReportCtrl().FocusSubItems(TRUE);

GetReportCtrl().m_bSortedDragDrop = TRUE;

GetReportCtrl().GetPaintManager()->SetHeaderRowsDividerStyle(xtpReportFixedRowsDividerBold);

GetReportCtrl().GetPaintManager()->SetFooterRowsDividerStyle(xtpReportFixedRowsDividerBold);

GetReportCtrl().GetPaintManager()->SetDrawGridForEmptySpace(TRUE);

GetReportCtrl().GetPaintManager()->SetFreezeColsDividerStyle(xtpReportFreezeColsDividerThin | xtpReportFreezeColsDividerShowAlways);

GetReportCtrl().GetColumns()->GetFirstVisibleColumn()->SetAutoSize(FALSE);

GetReportCtrl().RedrawControl();

GetReportCtrl().GetReportHeader()->SetLastColumnExpand(TRUE, TRUE);

}

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

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 27 October 2009 at 11:27am

See screenshot...

PokerMemento - http://www.pokermemento.com/
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 October 2009 at 11:30am
This is not a sample I asked to look - check my way in CReportPaneViewView::OnInitialUpdate
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 29 October 2009 at 6:54am
What am I supposed to check? There is an obvious drawing problem when scrolling if this function has been called.
PokerMemento - http://www.pokermemento.com/
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 01 February 2010 at 8:02am

Was this fixed for 13.2.2+?

PokerMemento - http://www.pokermemento.com/
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.