Problem  windows form modal in SAP BO

Dear all.
I have a problem.
I developed an Add-on to show a windows form. The windwos form call the
Cyristal Report's viewer. The form is call in a separeted Tread:
  Dim mySC As New Class1
                        designThread = New System.Threading.Thread(New System.Threading.ThreadStart(AddressOf mySC.Disegna))
                        designThread.Name = CR_REPORT_NAME_SCAD_COD_CLI
                        designThread.ApartmentState = System.Threading.ApartmentState.STA
                        designThread.Priority = Threading.ThreadPriority.Highest
                        designThread.Start()
Now it happens that :
     the first time I run the form that's OK, but if i try to run it again      without stopping the application there is an error not clearly specified.
     Additionally the first time , when all seems Ok,
     the form is not bring to front
(i used the property topmost=true and the method showdiagol).
CAN YOU HELP ME??? THANKS

Antonio,
In the SAP Business One forum for the SDK, ie. this forum, in the forum "Search" on the main page, type in "crystal".  You will see many posts that may help assist with you question that you can read through.
Hope this helps,
Eddy

Similar Messages

  • Problem with Windows Form called from SAP

    I have a simple VB.NET windows form that I'm calling from a new menu click event from within SAP.
    The form loads, as expected, when the menu item is clicked, but the form will always load outside of the SAP window and thus cannot be seen by the user unless they see it in their toolbar.
    Has anyone run into this in the past?  I would normally use the UI-API, but this is a form from another program that can't use the UI-API.
    I've also tested this with simple test forms with another test project and get the same results.
    Any ideas?
    Thanks!

    This isn't merely a matter of viewing <i>new</i> windows.
    When the SBO window is active and in full screen mode and one switches, using the task bar, to another application, more often than not the other application's window won't be displayed, or will be displayed but partially. One has to deactivate and re-activate the second window to see it correctly.
    It's the whole bloody SBO graphical engine that's bogus, if you ask me. Talk about reforging <i>that</i> to a profit-oriented company...
    @Marc Roussel:
    BTW, System.Windows.Forms.Form#ShowDialog() is a blocking method, AFAIK. So the following statements won't be executed ere the "dialog"'s closed.
    But this doesn't change the problem. The Activate() and BringToFront() don't help resolve the matter, in my experience. Sometimes the new form will appear on Z-top, sometimes it won't. Or maybe the true problem is that the window <i>is</i> on top, but doesn't get painted.
    ADDENDUM:
    Come to think of it, it might be worth a try to programmatically iconify/deiconify the new window. Something along the lines of:
    Dim f as Form = ...
    f.Show()
    Application.DoEvents()
    f.WindowState = FormWindowState.Minimized
    Application.DoEvents()
    f.WindowState = FormWindowState.Normal
    Application.DoEvents()
    (all in System.Windows.Forms Namespace)

  • Reset window / form position inside SAP Screen

    Hi,
    I have an odd question, I accidentally dragged by Sales Order Form/Window up too high - now I cannot see the top bar of it as it is under the SAP menu - so I cannot grab the top to drag it down.
    This is very frustrating as the I cannot see the BP field chooser or move the position of this form.
    Can someone please tell me how to either move it with keyboard actions or reset its position ?
    Thanks

    Hi
    Please try to cascade the windows
    (Main Menu-windows-cascade)
    Helen Sun

  • How do I enter a data to B1 form via windows form?

    I'm trying to add the data from a windows form, to the SAP B1 form (e.g. Sales order), now i'm just trying 1 component only which is the CustCode.
    I've been thinking about this but i can't figure it out like how's the structure of the class I should create...
    In my VBproj (VS_2005), i have a simple form (just "TextBox1" and "Button1"), then I have a class "appending.vb":
    Option Strict Off
    Option Explicit On
    Public Class appending
        Public oItem As SAPbouiCOM.Item
        Public oTextbox As SAPbouiCOM.EditText
        Private WithEvents SBO_Application As SAPbouiCOM.Application
        Private Sub SetApplication()
            Dim SboGuiApi As New SAPbouiCOM.SboGuiApi
            Dim sConnectionString As String
            sConnectionString = Environment.GetCommandLineArgs.GetValue(1)
            SboGuiApi.Connect(sConnectionString)
            SBO_Application = SboGuiApi.GetApplication()
        End Sub
        Public Sub New()
            MyBase.New()
            SetApplication()
        End Sub
    End Class
    and also Form1.vb class:
    Public Class Form1
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim oappend As New appending
            If oappend.oitem.UniqueID = 4 Then
                oappend.oitem.String = TextBox1.Text
            End If
        End Sub
    End Class
    Note that unique ID 4 is because i searched in the system information (CtrlSfihtD) that the customerID in the sales order form has the Item = 4, which is the unique ID, but this property is readonly prop, so that I can't directly instruct to append the data from textbox1 to the item where unique ID is 4 (..UniqueID = 4..)
    I know my code just wont work at all, but i'm really have no more idea about this....
    critics, comment and idea please...
    Thanks,
    Martin

    Dear Martin,
    I think String property is on EditText object not Item object.
    Please use Item.Specific to get the coresponding EditText and then set String.
    Regards,
    Jay.

  • Windows Form with SAP B1 Problem

    Dear all,
    I'm building an add-on that use some windows form.
    In Menu Event i placed the code for open my windows form:
                        MyForm xxx = new MyForm();
                        xxx.WindowState = System.Windows.Forms.FormWindowState.Normal;
                        xxx.Visible = true;
                        xxx.ShowInTaskbar = true;
                        xxx.TopMost = true;
                        xxx.Text = string.Empty;
                        xxx.ControlBox = false;
                        System.Windows.Forms.Application.Run(xxx);
    All works fine, but, when my form is open i can't operate on SAP.
    It's like my form is modal, and until I have it open I can't do anything outside the form.
    Can someone help me?
    Regards
    Diego

    Hi Diego
    There's actually two ways to build an add-on, one that runs inside SAP Business One and one that runs along SB1 side but built on windows forms.  You can see this clearly if you try some of the add-on samples that come along with B1.  Overall, when I did the analysis I ended up with the conclusion that I was going to spend twice the work to achieve windows forms.
    First, you would have develop classes and objects that keep in communication with Business One.  Second, you have to keep in mind that you cannot create, update, or delete data directly to the database unless you use the SDK provided objects and methods.  Which brings you back to the SAP data sources.
    Furthermore, you can run into a bit of complexity do to the fact that to illustrate data in your form, you might have to "convert" your data.  For instance, say a SAP recordset into a dataset or ADO recordset.  In other words, you can end up with a bit more complex architecture the way I see it.
    Using the Screen Painter and SAP Business One tools such as the BIDE you can construct bound form (UDOs) which can even require very little coding from your part (if forms are not to be too complex).  Once you get use to SAP's way handling data objects you see is a lot easier than trying the alternative.

  • Crystal Report Windows Forms Viewer problems - table could not be found

    Hi,
    I installed Crystal Report Viewer in SAP Business One 2007. All the while, I can run the reports without any problem. but when I loaded some of the new report, it gives me the following error message:
    the caption says: "Crystal Reports Windows Forms Viewer"
    the message says: "The table 'paymentVoucher' could not be found.
    Error in file C:\...paymentVoucher.rpt. The table could not be found."
    By the way, I can run the report in another workstation.
    Any help or ideas of why this is happening or how to solve this will be greatly appreciated.
    Thanks in advance.

    The report is not created by me. I just help others to transfer the report from one workstation to another workstation. PaymentVoucher is a view in the database and it is being put at a workstation that can be shared by everyone.
    I've go through other forums and found out that it might be permission issues and now managed to solve the problem already.
    Thanks everyone for the advice.

  • User Windows Forms in SAP

    Hi, is there an easy and quick way to use my Forms I made, which look like SAP forms as an AddOn in SBO?
    Maybe you know Mari-Projekt. The functionality should be the same. I have a stand-alone software but I also want to use it as an AddOn.
    Thanks Philipp

    Hi
    You can Open your windows forms in SAP Business One with a little bit work around.But event handlers for the form will be of .Net(like Button Clicks).But the problem is that you have to use showdialog property of form to show the form,Which will not allow you to access Sap Business One untill you close the windows form.
    If you want to handle your form events form with SDK,i am not sure whether that is feasible or not.
    Hope this helps you
    Regards
    Vishnu

  • Strange Problem with windows form in SBO

    Hi all
    I encountered a strange problem
    I have a standard .net windows form that I am activating from a menu in SBO
    In the test Env. in our office the form always shows on top, whoever in the customer site first time you activate the menu the form appears correctly on top but when you close the form and press the menu again the form will appear "behind" the SBO.
    The form will appear on top only the first time you use it.
    The form is set to TopMost true
    I also tried using the user32.dll functions of SetFocus and SetForgroundWindow
    (I put them in the Activated event of the form)
    But it made no difference – first time form on top - the rest the from is behind
    The form is run on a separate thread and as I said works perfectly in the test Env.
    I am using .net 2005 with SBO 2005
    Any Ideas ?
    Thanks
    Ronny

    Hi Roni,
    I think you will find the answer to your question in this thread.
    https://forums.sdn.sap.com/click.jspa?searchID=3636651&messageID=844077
    Regards,
    Felipe

  • Problem in adding "TableLayoutPanel" control array type functionality on windows form dynamically using drag and drop

    Environment: -
     (Application Machine)
    OS Name             : -
    Microsoft Windows 7 Professional/XP SP2/SP3            
    OS Bit Version      : -
    32 Bit                     
    Application Name: - Designer.exe                                  
    IDE                  
        : - Visual Studio 2008                        
    EXE Application development: -
    VB. Net
    Application Type: -
    Application “Designer.exe” was designed in vb6.0 and now, it has been upgraded to Visual Studio 2008 and it works properly.
    Product Description: -
                 We have an application Designer.exe, which is used for designing “Forms”.
    It has menu option with following option like Panel, Text Box, Combo Box, Button etc. We drag any of this menu items and place it to form.
    Requirement: -
    We have
    critical requirement in product. In Designer.exe, we need to align form margin, while we increase or decrease window. And for that we have searched that 
     “TableLayoutPanel” components can be helpful.
    Problem description: -
    Earlier code was in vb6.0, now it has upgraded to Visual Studio 2008. In vb6.0, we have used control array for memory utilization with Combo Box, Group Box, and Text
    Box etc.
    But, for alignment we have to use “TableLayoutPanel”
    control array type functionality on form.
    Code Snippet: - For earlier designing component e.g. Frame
    'Required by the Windows Form Designer
    Public WithEvents Frame1 As Microsoft.VisualBasic.Compatibility.VB6.GroupBoxArray
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    Me.components = New System.ComponentModel.Container
    Me.Frame1 = New Microsoft.VisualBasic.Compatibility.VB6.GroupBoxArray(Me.components)
    CType(Me.Frame1, System.ComponentModel.ISupportInitialize).BeginInit()
    . Kindly suggest approach for implementing requirement.
    Kindly help us to complete the requirement. I will be really
    thankful for any assistance.

    Hi S.P Singh,
    Welcome to MSDN.
    I am afraid that as Renee Culver said, these forums donot support VB6, you could refer to this thread:
    Where to post your VB 6 questions
    You could consider posting this issue in these forums below:
    These forums do not support Visual Basic 6, however there are many third-party support sites that do. If you have a VB6-related question please visit these popular forums:
    VB Forums
    VB City
    Thanks for your understanding.
    Best Regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Problem with Cyrstal Report viewer in a Windows Form App Franework 4.0

    I appear to have a issue with Cyrstal Reports runt-time 13.0.2000.0 in a Windows 7 64 bit environment.
    Crystal Report Viewer is not displaying the report but instead is displaying the logon screen with the database name missing.
    1.) App is a .net windows form app using 4.0 framework compiled in the visual studio 2010.
    Compile machine has the development evironment for crystal report 13.0.2000.0 loaded. Compiled for any CPU.
    The Viewer is setup to access the report using oledb conection with sql server using SQL authentication.
    The Viewer works great for all enviroments except for windows 7 64 bit.

    Hello,
    Set your project for X64 only, and note for 32 bit OS then set it for x86. It's a MSIExec issue and not CR. If MSIExec detects a 64 bit OS but your app is using 32 bits then you'll run into distribution problems.
    If you are using MS SQL Server 2008 then you have to install the Client Tools and select the SQL Native 10 driver. MS doesn't support MDAC DB drivers to MS 2008. Search MS's site for more info.
    You also need to install the 64 bit Client Tools for this to work on a 64 bit OS's.
    If you are using SQL 2005 then you have to use the MS OLE DB Provider for SQL Server, Cr doesn't support the Native driver for 2005.
    I use this configuration all the time so it should work.
    Also, are you using SP 1? The GAC Assembly version always stay the same, it's the dll version we need to know.
    Don

  • Problems with the System.Windows.Forms.Timer

    Hi All,
    Could some one help me please? I'm having a problem using the System.Windows.Forms.Timer inside an ItemEvent, the timer event just doesn't works...give a look in my code:
    private System.Windows.Forms.Timer myTimer = new System.Windows.Forms.Timer();
    if (pVal.FormUID.Equals("FrmTimer") && pVal.ItemUID.Equals("btnStartTimer") && (pVal.Before_Action.Equals(true)) && (pVal.EventType.Equals(SAPbouiCOM.BoEventTypes.et_CLICK)))
                myTimer .Interval = 1000;
                myTimer .Enabled = true;
                myTimer .Tick += new EventHandler(myTimer _Tick);
    void myTimer _Tick(object sender, EventArgs e)
                SBO_Application.MessageBox("Timer: " + DateTime.Now, 1, "OK", "", "");
    does someone have already tried to use the timer inside an itemevent, or could suggest another solution?
    thanks a lot...

    Hi Bruno,
    Unfortunately you cannot use a Forms.Timer without using a windows form (ie not a SBO form). Have you looked at the other 2 timer objects in .Net, the System.Timer.Timer and System.Threading.Timer? Here's a link to a web page that goes through the differences between each one:
    http://msdn.microsoft.com/msdnmag/issues/04/02/TimersinNET/
    Kind Regards,
    Owen

  • Database Connection Problem via a Windows Form

    I am having a problem getting a database connection using a windows form. The strange thing is I can use the same connection string in the sister web application and the database connection works perfectly fine.
    I am using:
    .NET 1.1
    ODP.NET 9.2.0.700
    Oracle 9i PatchSet 11
    Here is an example of the connection string:
    _oraConnStringMain = "Data Source=mydb;User Id=myid;Password=mypass"
    The error is: "ORA-12154: TNS:could not resolve service name" and remember the same connection string and implementation is the web application works fine.
    Offending code:
              public bool ValidateOracleConnection(string connectionString)
                   bool _success = false;
                   OracleConnection oraConn = new OracleConnection(connectionString);
                   try
                        oraConn.Open();
                        _success = true;
                   catch (Exception ex)
                        MessageBox.Show(ex.Message.ToString(), "MYAPP", MessageBoxButtons.OK,
                             MessageBoxIcon.Information);
                        _success = false;
                   return _success;
    Any ideas?

    Hi Steven,
    My only WAG is that a different sqlnet.ora or tnsnames.ora might be used for the two different apps. Search your machine for both files. Are they only in the OH\network\admin directory?
    You may want to run a client side sqlnet trace of both apps, and compare them. It should tell you what tnsnames.ora file it's using, and may give a clue as to why the difference.
    Hope that helps,
    Greg

  • How to show windows form in SAP B1

    Hi
    I would like to create interface UI form using C# , windows form and add to SAP B1. I would like to know process and send me if you have any sample code please.
    Thanks
    rl

    Hi ragno liver.
    This are the step to create your addon. :
    1- On the menu bar access projects then properties and on Debug you will find the Command line add the following:
    0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056
    2- Add References SAPbouiCOM and SAPbobsCOM
    3- Add a module call SubMain to your project
    4- Go to project properties then to the application and then uncheck Enable Application framework. And select SubMain on the starud object.
    5- On the SubMain module add this code:
    using System;
    using System.Windows.Forms;
    class SubMain {
    static void Main() {
    // Creating an object
    MyClase oMyClase = null;
    oMyClase = new MyClase();
    // Start Message Loop
    System.Windows.Forms.Application.Run();
    Where MyClase are located the code to create your menu and the call to your form.
    Regards,
    Jose

  • Show windows form on SAP

    Hi.
    I am opening a windows form and have this problem.
    When open the form this show on the taskbar. But it doesn't maximize.
    I am need that this form maximizes. How can I do this?
    Regards,
    Jose

    Hi ragno liver.
    1- On the menu bar access projects then properties and on Debug you will find the Command line add the following:
    0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056
    2- Add References SAPbouiCOM and SAPbobsCOM
    3- Add a module call SubMain to your project
    4- Go to project properties then to the application and then uncheck Enable Application framework. And select SubMain on the starud object.
    5- On the SubMain module add this code:
    using System;
    using System.Windows.Forms;
    class SubMain {
        static void Main() {
            // Creating an object
            MyClase oMyClase = null;
            oMyClase = new MyClase();
            //  Start Message Loop
            System.Windows.Forms.Application.Run();
    Where MyClase are located the code to create your menu and the call to your form.
    Regards,
    Jose

  • Opening Sap Form(cfl) on top of windows form added in an adddon

    Hi
    On a click of sapForm button,I have opened a windows form containing a buton on it .
    Now on a click of this button I have opened the Cfl created on Sap form.but its opening at the back of the Windows  form .I need to minimize my Windows form to view the Cfl opened .I want this cfl to be open on top of windows form on whose button click i have opened it.
    your suggestions are urgently required.
    Regards
    Mandeep

    Hi Mandeep,
    This thread may be a useful reference for you: Why the open file dialog form goes to SAP background.
    Regards
    Aravind

Maybe you are looking for