Skip to Content

In the new ver, SBO SDK supports the LayoutKeyEvent.

The event allows us to open our crystal report attached to our user form.

However, this event is not supported by the B1DE 2.2(which is the latest version available as of this writing.)

I have modified the B1Wizardbase.dll to support for this event.

I will not discuss about this Event, instead you should check this Blog : http://www.sdn.sap.com/irj/scn/weblogs?blog=%2Fpub%2Fwlg%2F26720

And the discussion in this thread : View Crystal Report from add-on

You can download the DLL here.

How to use the DLL :

1. Create your addon using the B1DE wizard as usual.

2. Under the Debug/Release folder, look for the B1Wizardbase.dll file, replace this file with the modified B1Wizardbase.dll.

3. Use the declaration of the event as below :

   class MyClass : B1Event
    {
        [B1Listener(BoEventTypes.et_PRINT_LAYOUT_KEY, true, new string[] { "frmUID" })]
        public virtual bool OnBeforePrintLayOutKey(LayoutKeyInfo eventInfo)
        {
            eventInfo.LayoutKey = "DocEntry";
            return true;
        }
     }

The above declaration might be different if your class is inheriting from other than B1Event.

That’s it, the event should be captured just fine.

Happy coding.

Edy

To report this post you need to login first.

5 Comments

You must be Logged on to comment or reply to a post.

  1. Edy Simon Post author

    HI Marc,

    When you provide the DocEntry in the lay out key event,

    It is something like you provide the crystal report parameter value.

    The Parameter name in the CR has to be DocKey@


    In the your crystal report you will assign the DocKey@ as your parameter to the view.


    Regards

    Edy


    (0) 
  2. Wen Choon Mok

    Hi Edy,

    I’m using your modified B1Wizardbase.dll for printing CR layout from UDO form. Unfortunately it does not work on B1 ver 9.0. Is it possible to have the dll compiled for B1 ver 9.0? Or is there any workaround way to get the existing dll to work on B1 ver 9.0?

    Thanks in advance.

    Best regards, Mok

    (0) 
      1. Wen Choon Mok

        Hi Edy,

        Thanks. However it seems it is the same dll that I’ve downloaded previously and it is still showing the “Unable to find dependency ‘INTEROP.SAPBOUICOM’ (Signature='(null)’ Version=’8.8.0.0′) of assembly ‘B1WizardBase.DLL” warning message when building the add-on project. Could this warning be ignored? Or is it possible to provide some hints how I may add the event into the B1DE source code and rebuild the dll.

        Thanks & rgds, Mok

        (0) 
        1. Edy Simon Post author

          Hi Mok,

          Did you clean your project before referencing the new B1WizardBase.DLL ?

          Just to make sure :

          1. Remove the reference from your project.

          2. Build – Clean the project.

          3. Go to your Obj folder, remove the whole folder.

          4. Go to your Bin folder, remove any B1Wizardbase.dll if exists.

          5. Go back to your project and re-reference the new B1Wizardbase.dll and re-build your project.

          If you have the source code, you may do so, the easiest way is to follow the existing declaration and handling of the other events, i suggest [BoEventTypes.et_PRINT_DATA]

          Open up the B1Wizardbase project and look inside the EventTables.cs

          Regards

          Edy

          (0) 

Leave a Reply