on 07-07-2015 4:40 AM
Hi All
I'm trying to view my crystal report on my form but i stuck on how to Add Layout Key Event Handler.
below is my code in vb.net. what is i missing?
when i debug on line
B1Connections.theAppl.LayoutKeyEvent = New _IApplicationEvents_LayoutKeyEventEventHandler(AddressOf theAppl_LayoutKeyEvent)
It show error "Public member 'LayoutKeyEvent' on type 'ApplicationClass' not found."
anyone please help me
<B1Listener(BoEventTypes.et_FORM_LOAD, False)> _
Public Overridable Sub OnAfterFormLoad(ByVal pVal As ItemEvent)
Dim ActionSuccess As Boolean = pVal.ActionSuccess
Dim form As Form = B1Connections.theAppl.Forms.Item(pVal.FormUID)
'ADD YOUR ACTION CODE HERE ...
B1Connections.theAppl.LayoutKeyEvent = New _IApplicationEvents_LayoutKeyEventEventHandler(AddressOf theAppl_LayoutKeyEvent)
End Sub
Private Sub theAppl_LayoutKeyEvent(ByRef eventInfo As LayoutKeyInfo, ByRef BubbleEvent As Boolean)
BubbleEvent = True
eventInfo.LayoutKey = "1"
End Sub
Thanks,
Vita
Hi Vita
Private ThisFormEvent As SAPbouiCOM.EventForm = Nothing
ThisFormEvent = SBO_Application.Forms.GetEventForm(ThisFormType)
RemoveHandler ThisFormEvent.LayoutKeyBefore, AddressOf theAppl_LayoutKeyEvent
AddHandler ThisFormEvent.LayoutKeyBefore, AddressOf theAppl_LayoutKeyEvent
Regards
Edy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vita,
Can you try :
1. Move the declaration of 'Private ThisFormEvent As SAPbouiCOM.EventForm = Nothing' as a global variable in your module as 'Public ThisFormEvent as SAPbouiCOM.EventForm'.
And Remove the declaration in this current class.
2. Have you set the oForm.ReportType property ? if you havent, set this during your initialization of this form.
Regards
Edy
Hi Edy,
Sorry for late response.
I declare 'Public ThisFormEvent As SAPbouiCOM.EventForm = Nothing' as global variable but it still not fire LayoutKeyBefore event.
I Also try RemoveHandler,AddHandler with another event ex. closebefore , loadbefore etc. it work well except LayoutKeyBefore event.
And I already set form.reporttype property. What should i do next? Please help again.
Thanks in advance,
Vita
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.