CXTPReportSelectedRows::SelectBlock Problem |
Post Reply |
Author | |
Danlar
Groupie Joined: 27 February 2008 Location: United States Status: Offline Points: 12 |
Post Options
Thanks(0)
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Take recent updates - and rebuild your dll and app - https://forum.codejock.com/uploads/DemoVersion/ReportControlMFCUpdated.rar
https://forum.codejock.com/uploads/DemoVersion/ReportSampleStaticExt.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!
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |