Print Page | Close Window

[SOLVED] v15.1.3.0908 SetFocusedRow(NULL)

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=18930
Printed Date: 16 November 2024 at 4:54pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED] v15.1.3.0908 SetFocusedRow(NULL)
Posted By: markr
Subject: [SOLVED] v15.1.3.0908 SetFocusedRow(NULL)
Date Posted: 09 September 2011 at 8:24am
In the new v15.1.3.0908 release of the XTP report control, I get an immediate crash if I invoke:

GetReportCtrl().SetFocusedRow(NULL);

Support for using NULL in this context was added to 15.1.1 to allow us to clear the currently focused row. The crash occurs because the method signature above calls EnsureVisbile(), which in turn doesn't always check to see if the row is NULL.

This problem can be worked around by instead calling:

GetReportCtrl().SetFocusedRow(FALSE, NULL, FALSE, FALSE);

... which bypasses the attempt to ensure row visibility (and thus avoids the crash).

For long term solution, recommend that CodeJock change CXTPReportControl::EnsureVisible(CXTPReportRow *pRow) method so that it *always* checks for NULL row pointer.



Replies:
Posted By: ABuenger
Date Posted: 09 September 2011 at 11:20am
Thanks, fixed.



-------------
Codejock support


Posted By: adrien
Date Posted: 21 September 2011 at 5:18am
I found this too, but it occured when I removed all records from a report.  So it's necessary to be able to call  CXTPReportSections::EnsureVisible(CDC *pDC, CXTPReportRow *pRow) with pRow = NULL.

e.g. XTPReportSections.cpp line 86


BOOL CXTPReportSections::EnsureVisible(CDC *pDC, CXTPReportRow *pRow)
{
BOOL bResult = FALSE;
if(!pRow)
return bResult;


solves the problem for me



-------------
http://www.wingate.com - http://www.wingate.com



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