Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Can't edit in report control
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Can't edit in report control

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


Joined: 23 August 2006
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote garylyb Quote  Post ReplyReply Direct Link To This Post Topic: Can't edit in report control
    Posted: 13 September 2006 at 11:25pm
 
I have a report control in a CFormView,
 
It looks like I'm doing the same things as the task list sample

pCol->SetEditable(TRUE);

pCol->GetEditOptions()->m_bAllowEdit = TRUE;

I set allowedit:

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
garylyb View Drop Down
Newbie
Newbie


Joined: 23 August 2006
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote garylyb Quote  Post ReplyReply Direct Link To This Post Posted: 14 September 2006 at 7:44am

Something is eating messages here, Here is atrace of the task list sample:

 
<00738> 00A905F0 R WM_NOTIFYFORMAT retCode:NFR_ANSI
<00739> 00A905F0 S WM_NCHITTEST xPos:623 yPos:153
<00740> 00A905F0 R WM_NCHITTEST nHittest:HTCLIENT
<00741> 00A905F0 S message:0x2A48 [User-defined:WM_USER+9800] wParam:00000000 lParam:00000000
<00742> 00A905F0 R message:0x2A48 [User-defined:WM_USER+9800] lResult:00000000
<00743> 00A905F0 S WM_NCHITTEST xPos:620 yPos:148
<00744> 00A905F0 R WM_NCHITTEST nHittest:HTCLIENT
<00745> 00A905F0 S WM_SETCURSOR hwnd:00A905F0 nHittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE
<00746> 00A905F0 R WM_SETCURSOR fHaltProcessing:False
<00747> 00A905F0 P WM_MOUSEMOVE fwKeys:0000 xPos:237 yPos:11
<00748> 00A905F0 S WM_NCHITTEST xPos:620 yPos:148
 
Here is my app:
 
00340> 00B5078E R WM_SETCURSOR fHaltProcessing:False
<00341> 00B5078E S WM_NCHITTEST xPos:407 yPos:548
<00342> 00B5078E R WM_NCHITTEST nHittest:HTCLIENT
<00343> 00B5078E S WM_NCHITTEST xPos:407 yPos:548
<00344> 00B5078E R WM_NCHITTEST nHittest:HTCLIENT
<00345> 00B5078E S WM_SETCURSOR hwnd:00B5078E nHittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE
<00346> 00B5078E R WM_SETCURSOR fHaltProcessing:False
<00347> 00B5078E P WM_MOUSEMOVE fwKeys:0000 xPos:180 yPos:32
<00348> 00B5078E P WM_PAINT hdc:00000000
<00349> 00B5078E S WM_NCHITTEST xPos:407 yPos:548
 
These messages are missing:
 
<00742> 00A905F0 R message:0x2A48 [User-defined:WM_USER+9800] lResult:00000000
 
This is a tab in a

CXTPTabControl

in an mdi window.
 
Gary
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 14 September 2006 at 11:45am
Hello,
 
This problem can appear beacuse of clip styles - check that report, tabcontrol and view have WS_CLIPSIBLINGS|WS_CLIPCHILDREN styles
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
garylyb View Drop Down
Newbie
Newbie


Joined: 23 August 2006
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote garylyb Quote  Post ReplyReply Direct Link To This Post Posted: 14 September 2006 at 3:40pm

I just uploaded a file in the support area that demonstrates the problem.

OnInitialUpdate gets hit twice, the report control can't be edited, the windows are all set to WS_CLIPSIBLINGS|WS_CLIPCHILDREN

I can't get any farther until this gets resolved.

Thank you

Gary

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 15 September 2006 at 1:14am
Hi,
 
You didn't copy one method from our sample:
 

ON_WM_MOUSEACTIVATE()

...

int CTest1View::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)

{

return CWnd::OnMouseActivate(pDesktopWnd, nHitTest, message);

}

 
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 15 September 2006 at 1:15am
About WM_INITIALUPDATE - just comment

pWnd->SendMessage(WM_INITIALUPDATE)

in CTest1View::AddView. We fixed it in our sample too.
Thanks.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
garylyb View Drop Down
Newbie
Newbie


Joined: 23 August 2006
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote garylyb Quote  Post ReplyReply Direct Link To This Post Posted: 17 September 2006 at 9:36am
Thank you very much, I looked at the OnMouseActivate several times, and kept saying it doesn't do anything, so I ignored it.
 
It does, however, call CWnd instead of CView, so once that finally sunk in, I added it.
 
Thanks again,
 
Gary
 
Back to Top
TerryT View Drop Down
Newbie
Newbie


Joined: 31 August 2006
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote TerryT Quote  Post ReplyReply Direct Link To This Post Posted: 15 October 2006 at 7:46am
Ditto on the "finally sunk in"
 
Restored the "OnMouseActivate()", all is fine!
Thx!
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.