Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Focus on a Case
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Focus on a Case

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


Joined: 04 June 2008
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote sisge Quote  Post ReplyReply Direct Link To This Post Topic: Focus on a Case
    Posted: 04 June 2008 at 12:03pm
Hey,
I'm controlling the value of an item after the item lost focus and when it's a wrong value, I'd like to have the focus back to this item.
 
I tried making the item "focusable" or using rptcontrol.SetFocus but I can't make it work.
 
Anybody would have an idea.
 
Thanks !
Back to Top
Phillip View Drop Down
Newbie
Newbie


Joined: 31 March 2008
Location: South Africa
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote Phillip Quote  Post ReplyReply Direct Link To This Post Posted: 04 June 2008 at 1:29pm
You could try BeginEditAt method call. This will position the report control to a specific row/column intersection.
Regards.
Back to Top
sisge View Drop Down
Newbie
Newbie


Joined: 04 June 2008
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote sisge Quote  Post ReplyReply Direct Link To This Post Posted: 05 June 2008 at 3:50am
Thanks for your answer.
 
I have a problem though, maybe stupid, but I can't find the beginedit function. In the object browser, I'm only finding it as an event.
 
Do I have to change some settings before ?
 
Thanks again !
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 05 June 2008 at 4:21am
Hi,
 
BeginEditAt is only available in V12.0
 
BeginEdit is available in V11.2 (I don't know if available in earlier versions)
 
wndReportControl.Navigator.MoveToColumn 1
wndReportControl.Navigator.MoveToRow 1
wndReportControl.EditItem wndReportControl.FocusedRow, wndReportControl.FocusedColumn
 
This will select row 1 and column 1 and will set the item in editmode
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
sisge View Drop Down
Newbie
Newbie


Joined: 04 June 2008
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote sisge Quote  Post ReplyReply Direct Link To This Post Posted: 05 June 2008 at 10:43am
Thanks Aaron for your quick answer.
So I tried and it seems it's focusing on the item but maybe I was wrong using the word "focus". So I'm trying to upload a picture to explain probably better than me.
 
So here is what I get.
 
Here is what I'd like to have.
 
I'd like that when people are wrong typing the item, it's already ready to type again.
 
Also, I have the v12.0 but I didn't find the Begineditat (but maybe it's also only to focus on the item, not make it ready to type).
 
Hope I'm not complicate to understand.
 
Thank you !
 
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 05 June 2008 at 10:52am
Hi,
 
Is that a microfilm, I don't have equipment to read that
 
You can upload a larger image so I could really see what you mean, its soooo tiny.
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
younicke View Drop Down
Senior Member
Senior Member
Avatar

Joined: 11 March 2005
Status: Offline
Points: 107
Post Options Post Options   Thanks (0) Thanks(0)   Quote younicke Quote  Post ReplyReply Direct Link To This Post Posted: 05 June 2008 at 11:04am
aaron you have to click on the image 
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 05 June 2008 at 11:18am
Originally posted by younicke younicke wrote:

aaron you have to click on the image 
 
Wow, I DO have the equipment, just a mouse will do the trick   
 
Thanks 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 05 June 2008 at 11:58am
Originally posted by sisge sisge wrote:

  
Also, I have the v12.0 but I didn't find the Begineditat  
 
Hi,
 
You are right @sisge, there's no method BeginEditAt
BeginEditAt is not available in V12.0 (I don't know what version Philip installed? maybe V12.1 ?) My mistake as well, sorry  
 
Can you upload a sample, I think it will be easier than explaining all options here. Please attached some info what you want me to do.
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
sisge View Drop Down
Newbie
Newbie


Joined: 04 June 2008
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote sisge Quote  Post ReplyReply Direct Link To This Post Posted: 06 June 2008 at 4:28am
Hi !
First, thanks a lot for the time you already spent helping me.
 
I cheated and used the example of wishmerhill and adapted it to my case.
So here it is :
 
Thanks again Sir !
Back to Top
Phillip View Drop Down
Newbie
Newbie


Joined: 31 March 2008
Location: South Africa
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote Phillip Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2008 at 1:24pm
Apologies. I meant to mention the EditItem and BeginEdit methods (I used these two to construct my own BeginEditAt function).
Back to Top
wismerhill View Drop Down
Newbie
Newbie


Joined: 16 May 2008
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote wismerhill Quote  Post ReplyReply Direct Link To This Post Posted: 09 June 2008 at 3:53am
Hello,

I find how to focus on a case but with a button.

This code works :
Public Sub Btn_Move_Click()
    'RptControl.EditItem Row, Column
    RptControl.FocusSubItems = True
    RptControl.Navigator.MoveToColumn 1
    RptControl.Navigator.MoveToRow 4
    RptControl.Navigator.BeginEdit
End Sub

but when i try to do the same in the event ValueChanged of the report, that do not work cause the click on another cells is the last step :
Value modified --> Move to cells(4, 1) --> set focus cells(4, 1) --> click on another cells

Do you know any other events where we can do the move function in last step ?     
Back to Top
wismerhill View Drop Down
Newbie
Newbie


Joined: 16 May 2008
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote wismerhill Quote  Post ReplyReply Direct Link To This Post Posted: 09 June 2008 at 3:58am
Remarks :
When i try the SelectionChanged Event, i have the following error :

Run-time error '28':
Out of stack space

Do you know what it means ?
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 10 June 2008 at 1:49am

Originally posted by wismerhill wismerhill wrote:

Hello,

I find how to focus on a case but with a button.

This code works :
Public Sub Btn_Move_Click()
    'RptControl.EditItem Row, Column
    RptControl.FocusSubItems = True
    RptControl.Navigator.MoveToColumn 1
    RptControl.Navigator.MoveToRow 4
    RptControl.Navigator.BeginEdit
End Sub

but when i try to do the same in the event ValueChanged of the report, that do not work cause the click on another cells is the last step :
Value modified --> Move to cells(4, 1) --> set focus cells(4, 1) --> click on another cells

Do you know any other events where we can do the move function in last step ?     

Hi,

Add a timer and let the timer sub do this job
 
Private Sub RptControl_ValueChanged(ByVal Row As XtremeReportControl.IReportRow, ByVal Column As XtremeReportControl.IReportColumn, ByVal Item As XtremeReportControl.IReportRecordItem)
       
    'The timer is necessary because the value changed event will be finished first.
    'If you would set: RptControl.EditItem RptControl.FocusedRow, RptControl.FocusedColumn in this sub
    'it will have no effect.
       
    If Item.Value < 100
        Timer1.Enabled = True
    End If
   
   
End Sub
Private Sub Timer1_Timer()
    RptControl.Navigator.MoveToColumn currentSelectedCol
    RptControl.Navigator.MoveToRow currentSelectedRow
    RptControl.EditItem RptControl.FocusedRow, RptControl.FocusedColumn
    Timer1.Enabled = False
End Sub
 
Now you can use any event where reference of row/column is returned
 
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
sisge View Drop Down
Newbie
Newbie


Joined: 04 June 2008
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote sisge Quote  Post ReplyReply Direct Link To This Post Posted: 10 June 2008 at 3:19am
It's working. Thanks a lot !!
Back to Top
wismerhill View Drop Down
Newbie
Newbie


Joined: 16 May 2008
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote wismerhill Quote  Post ReplyReply Direct Link To This Post Posted: 10 June 2008 at 3:24am
Originally posted by Aaron Aaron wrote:


Hi,
Add a timer and let the timer sub do this job
 
Private Sub RptControl_ValueChanged(ByVal Row As XtremeReportControl.IReportRow, ByVal Column As XtremeReportControl.IReportColumn, ByVal Item As XtremeReportControl.IReportRecordItem)
       
    'The timer is necessary because the value changed event will be finished first.
    'If you would set: RptControl.EditItem RptControl.FocusedRow, RptControl.FocusedColumn in this sub
    'it will have no effect.
       
    If Item.Value < 100
        Timer1.Enabled = True
    End If
   
   
End Sub
Private Sub Timer1_Timer()
    RptControl.Navigator.MoveToColumn currentSelectedCol
    RptControl.Navigator.MoveToRow currentSelectedRow
    RptControl.EditItem RptControl.FocusedRow, RptControl.FocusedColumn
    Timer1.Enabled = False
End Sub
 
Now you can use any event where reference of row/column is returned
 
 
 


I tought to use a Timer but hope I would try to find another way to solve the problem  ;)

Thanks anyway
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.