Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - About ReportControl cannot edit;
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

About ReportControl cannot edit;

 Post Reply Post Reply
Author
Message
lyl0625 View Drop Down
Newbie
Newbie


Joined: 27 July 2009
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote lyl0625 Quote  Post ReplyReply Direct Link To This Post Topic: About ReportControl cannot edit;
    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?
 
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 28 July 2009 at 11:31am
I guess it means there is no ReportRecordItem behind. How you create your records and items?
Back to Top
lyl0625 View Drop Down
Newbie
Newbie


Joined: 27 July 2009
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote lyl0625 Quote  Post ReplyReply Direct Link To This Post 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);
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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)

Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 03 August 2009 at 4:25pm
Get fresh upgrade please https://forum.codejock.com/uploads/DemoVersion/ReportControlMFCUpdated.rar
Little change for in-place combo case [double click and EditOnClick = FALSE combination]
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.156 seconds.