Print Page | Close Window

About ReportControl cannot edit;

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=14846
Printed Date: 05 May 2024 at 11:59pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: About ReportControl cannot edit;
Posted By: lyl0625
Subject: About ReportControl cannot edit;
Date Posted: 28 July 2009 at 3:32am
 have a report control in a CXTPReportView,
 

pCol->SetEditable(TRUE);

m_Report.AllowEdit(TRUE);

m_Report.Populate();
 
 
But, when I click on a cell, it looks like it starts to edit, but when I press a key I always get an exception here:
 
void CXTPReportInplaceEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)

{

CXTPReportControl* _pControl = pControl;

ASSERT(_pControl);

Because pControl is NULL
 
I don't know what's going on?
 



Replies:
Posted By: mdoubson
Date Posted: 28 July 2009 at 11:31am
I guess it means there is no ReportRecordItem behind. How you create your records and items?

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


Posted By: lyl0625
Date Posted: 28 July 2009 at 8:51pm
Thanks for you anttention!
I create the ReportRecordItem behind ,but I just cannot edit it.
this is my code,for example:
 
CXTPReportControl& wndReportCtrl = GetReportCtrl();
 CXTPReportRecord  *m_Record = new CMobileInfoReportRecord(1, "1","1","1");
 wndReportCtrl.AddRecord(m_Record);
 m_Record=new CMobileInfoReportRecord(2,"liaoyanli","040411008","mail");
 wndReportCtrl.AddRecord(m_Record);


Posted By: mdoubson
Date Posted: 29 July 2009 at 9:46am

You don't need to set pCol->SetEditable(TRUE); (this is default)

but you need to call wndReport.FocusSubItems(TRUE); (default is FALSE)

 Also check Sample Files: "MessageRecord.h" and "MessageRecord.cpp"

You will find how it set to use different types of ReportRecordItem

You can use CXTPReportRecordItem but only for display. If you need editable cell - use derived classes:

CXTPReportRecordItemText and similar. (Consider this as analog to CStatic, CEdit and so on)



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


Posted By: mdoubson
Date Posted: 03 August 2009 at 4:25pm
Get fresh upgrade please https://forum.codejock.com/uploads/DemoVersion/ReportControlMFCUpdated.rar - https://forum.codejock.com/uploads/DemoVersion/ReportControlMFCUpdated.rar
Little change for in-place combo case [double click and EditOnClick = FALSE combination]

-------------
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