Print Page | Close Window

CXTPReportSelectedRows::SelectBlock Problem

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=15021
Printed Date: 17 November 2024 at 8:11am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPReportSelectedRows::SelectBlock Problem
Posted By: Danlar
Subject: CXTPReportSelectedRows::SelectBlock Problem
Date Posted: 21 August 2009 at 10:12am
Hi,

I am having trouble using CXTPReportSelectedRows::SelectBlock. This problem first started to happen after I upgraded from version 12.1.1 to 13.1.0.

I will explain with an example:

Imagine I have a report control with 15 rows in it, no groups, no rows have child rows, and I have the 4th row from the top selected.

I am now calling myReport.GetSelectedRows()->SelectBlock(0, myReport.GetRows()->GetCount() - 1, TRUE) to select all rows. The result seems to be that only rows index 3 through 14 are selected (everything at or below my previous selection).

At the end of the function call to SelectBlock, the CXTPReportSelectedRows::m_arrSelectedBlocks member contains the following data:

i0: nIndexBegin=3, nIndexEnd=4
i1: nIndexBegin=0, nIndexEnd=15

I'm surprised to see there are more than one selected blocks, given that I passed TRUE for the bCallClear argument.


I don't understand. Am I using SelectBlock wrong, or is there a bug?

My final goal is to select all rows in the report control via code. I suppose there are other ways I can make that work, but I though I should bring this to your attention. Alternative solutions I've found include explicitly calling Clear before SelectBlock, or sending a message to hook into the new CTRL+A accelerator mentioned in the release notes, or calling _SelectRows, like the accelerator does, but that isn't a public function.

-Dan



Replies:
Posted By: mdoubson
Date Posted: 21 August 2009 at 1:02pm

Take recent updates - and rebuild your dll and app -

https://forum.codejock.com/uploads/DemoVersion/ReportControlMFCUpdated.rar - https://forum.codejock.com/uploads/DemoVersion/ReportControlMFCUpdated.rar
https://forum.codejock.com/uploads/DemoVersion/ReportSampleStaticExt.rar - https://forum.codejock.com/uploads/DemoVersion/ReportSampleStaticExt.rar
https://forum.codejock.com/uploads/DemoVersion/ReportPaneViewStatic.rar - https://forum.codejock.com/uploads/DemoVersion/ReportPaneViewStatic.rar
 
Select All Rows doing by Control+A - see what is reaction in ReportControl.cpp or ReportNavigator.cpp on such shortcut - no hook need!


-------------
Mark Doubson, Ph.D.



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