cancel
Showing results for 
Search instead for 
Did you mean: 

Working with XML

leon_laikan
Participant
0 Kudos

Hi, everybody

I am developing a quite big add-on using VB.NET and SDK

I started learning SDK using the samples given in SDK Help, and I develop everything entirely in code, because I have not learned other techniques.

All dimensions and positions are specified in code. I am not using any visual tool (Screen Painter, B1DE, SAP B1 Studio..)

I notice that my form is rather slow to load. Not a big problem, but if it loads faster, users will be more happy.

I have studied the "Working with XML"  example in DI sample, and notice it loads very fast (but it's a small file. Mine is much bigger).

I am thinking of converting all my forms into XML, but would like some advice before jumping ahead.

My Questions:


  • Does an XML form indeed load faster than the equivalent form specified in code?

  • Is it possible to adopt the approach I am thinking of: loading the XML file and adding the necessary SDK code?

  • I don't use simple  fixed dimensions because this gives rise to distorted screens when screen resolution changes.

           What I do is to calculate screen resolution using these codes:

           Public VirtualScreenWidth As Double = System.Windows.Forms.SystemInformation.VirtualScreen.Width 

           Public VirtualScreenHeight As Double = System.Windows.Forms.SystemInformation.VirtualScreen.Height

     

        Then I express all my dimensions and positions in terms of these variables. ex:

            oItem = FormSelx.Items.Add("O_ToOt", SAPbouiCOM.BoFormItemTypes.it_OPTION_BUTTON)

            oItem.TextStyle = SAPbouiCOM.BoFontStyle.fs_Bold

            oItem.Left = 0.5 * VirtualScreenWidth

            oItem.Top = 0.59 * VirtualScreenHeight

        Can a form be saved as XML even if dimensions are expressed  parametrized as above?

--------------

Added:

        Just as a test, I modified the XML file to incorporate a formula (125*2 instead of 250)

                 <item uid="EditText1" type="16" left="157" tab_order="0" width="125 * 2"

        But it does not work.

        My only hope is that it will work if the XML file is generated by SDK, not just edited .. but maybe I am dreaming!

-------------

  • Will it still be possible to create the .ard file as usual?

  • Any advice that can help me steer my project successfully?

Any advice will be most welcome. I never worked with XML before.

Thanks

Leon

Accepted Solutions (1)

Accepted Solutions (1)

maik_delly
Active Contributor
0 Kudos

Hi Leon,

the form loads much faster when using XML files. Basically you are just building the XML via code the way you are doing it.

I don't get exactly what you mean by " adding the necessary SDK code" since you are just shortcut the creation of the form - everything else stays as ist is.

I would strongly recommend to use B1Studio to create the forms - it is simply the easiest way. As for the dimensions and positioning I stay with what I said in the other thread.

Afaik you can't use formulas in integer fields - but you can of course modify your xml before adding it. The usual approach would be to calculate needed properties ( left,top, width..) when from is resized or loaded.

ARD creation is the same.

I don't know about your project, but you should definitly have a look into the B1Studio template for Visual Studio ( 2010 or SBO 9.1PL3 = 2013 ). If it is applicable ( it has some flaws ) in your case it would simplify your life a lot.

regards,

Maik

leon_laikan
Participant
0 Kudos

Hi, Maik

Thanks a lot for your reply.

And thanks a lot for being really patient with me.

You have stressed many times the importance of B1 studio, but you know, bad habits are difficult to change. Although hard coding is tough and time consuming, I have paradoxically come to love it. But I have started learning SAP B1Studio.

I have a few questions concerning SAP B1 Studio

  • Which edition to use?  SAP B1 Studio, or SAP B1 Studio for Visual Studio.
  • sorry- you already mentioned ...for VS

  • A big problem which I must solve is the problem of Screen Resolution. My projects are often enterprise wide: many users can use the same application at the same time. And all users don't have the same model of desktop computer, and the same VDU. Even if I buy the same model of VDU for everyone, sooner or later, I will have to replace a broken one, and the model may no longer be available.

       The big problem is that a perfect form displays only on the computer from which the

       form was designed. On all others, the form is distorted. I also have the problem of

       QUADRANT LINES mentioned last time.

      Does SAP B1 Studio solve the problem of Resolution. You mentioned RESIZING. But to

     use resizing, you've got to know the new screen resolution? Does Studio handle

     resizing automatically?

Best Regards

Leon

/

maik_delly
Active Contributor
0 Kudos

Hi Leon,

which version is up to you. In theory standalone B1 Studio is used by designers to create the form visually.

Personally I prefer the VS version if I create addons which are not complex or don't involve system forms ( to use the framework abilities ).

In all other cases I design the form in B1Studio and export as *.srf ( the "old" xml version of forms ).

Resolution / resize issues I handle in form resize after event if necessary - try to settle with a minimum form size and link items to each other ( folders and grids would need manual resizing in any case ).

B1 Studio is a tool and framework but nothing more ( no auto resizing ).

regards,

Maik

leon_laikan
Participant
0 Kudos

Thanks Mail

To really understand how you deal with the Resolution problem, I must try my hand at Studio, which I have already started.

Best regards

Leon

costas_ioannou2
Active Participant
0 Kudos

Hi, we have created an add-on with B1Studio and have saved it to XML. How can we load it so that it uses the events of the Form?

Answers (0)