Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - [SOLVED] How to get value from row and col
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic Closed[SOLVED] How to get value from row and col

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

Joined: 27 February 2007
Location: India
Status: Offline
Points: 140
Direct Link To This Post Topic: [SOLVED] How to get value from row and col
    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
Back to Top
SHAN View Drop Down
Groupie
Groupie
Avatar

Joined: 17 July 2010
Location: Dubai
Status: Offline
Points: 73
Direct Link To This Post 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
Back to Top
Makarand View Drop Down
Senior Member
Senior Member
Avatar

Joined: 27 February 2007
Location: India
Status: Offline
Points: 140
Direct Link To This Post 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
 
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Direct Link To This Post 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 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
Makarand View Drop Down
Senior Member
Senior Member
Avatar

Joined: 27 February 2007
Location: India
Status: Offline
Points: 140
Direct Link To This Post 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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Direct Link To This Post Posted: 20 June 2011 at 2:31am
Sorry;

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

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
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.172 seconds.