Print Page | Close Window

[SOLVED] How to get value from row and col

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=18557
Printed Date: 16 June 2025 at 3:33pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED] How to get value from row and col
Posted By: Makarand
Subject: [SOLVED] How to get value from row and col
Date Posted: 15 June 2011 at 1:03am
Hello CJ Team,

I want to get a value from my report which specified column# and row#.

eg. I have column number 2, and row number 2 which is having value "Test".

What is the way where I just send the col#(2) and row(2) so that I can get the "Test" string?

-Mak




-------------
-Mak



Replies:
Posted By: SHAN
Date Posted: 15 June 2011 at 4:01am
Hi Mak,

 You can use this...

     ReportControl1.Rows(2).Record.Item(2).Value





-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows 7 Professional
Language: Visual Basic 6.0


Posted By: Makarand
Date Posted: 16 June 2011 at 4:21am
Thanks for the reply !
Using following code I am able to retrieve the cell value with normal grid control

   CXTPReportRecord* pRecord=reinterpret_cast<CXTPReportRecord*>(m_lstViews.GetRecords()->GetAt(1));
   CString str = reinterpret_cast<CXTPReportRecordItemText*>(pRecord->GetItem(0))->GetValue();

but in case of virtual report it havent work. Here is the code sample that I am using for virtual report.

   CVirtualRecord* pRecord=reinterpret_cast<CVirtualRecord*>(GetReportCtrl().GetRecords()->GetAt(1));
   CString strValue=reinterpret_cast<CXTPReportRecordItemText*>(pRecord->GetItem(0))->GetValue();

Any suggestion why it is failing in virtual report?

-Mak
 


Posted By: mgampi
Date Posted: 16 June 2011 at 8:25am
Hi;

In virtual mode the control does NOT have any record set. It only has ONE record as aplaceholder. Whenever the report control requires data to be displayed it calls CXTPReportRecord::GetItemMetrics(). So you have to ask your underlying data container for the cell data and not the grid control.


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022


Posted By: Makarand
Date Posted: 20 June 2011 at 1:49am
Hello Martin,

Thanks for the reply, issue got fixed. 

I am stuck with one more issue with collapse/expand in virtual report. Can you please provide me VC6 sample source with working expand/collapse.

-Mak


Posted By: mgampi
Date Posted: 20 June 2011 at 2:31am
Sorry;

I haven't done this before! Perhaps Andre could help.


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



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