cancel
Showing results for 
Search instead for 
Did you mean: 

File ..path.Detest.xml not found

Former Member
0 Kudos

Hi Experts,

When i am trying to run my add on it is giving error like some path then Detest.xml. While i am not referencing any file Detest.xml..

My xml file name is test.xml...

here is thje code.

private void Testing()

{

SAPbouiCOM.Form oForm = null;

try

{

oForm = SBO_Application.Forms.Item("test");

SBO_Application.MessageBox("Form Already Open", 1, "Ok", "", "");

}

catch (Exception ex)

{

SAPbouiCOM.FormCreationParams fcp = null;

fcp = ((SAPbouiCOM.FormCreationParams)(SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)));

fcp.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Fixed;

fcp.FormType = "ft_Sizable";

fcp.UniqueID = "test1";

string transTemp0 = "test.xml";

fcp.XmlData = LoadFromXML(ref transTemp0);

oForm = SBO_Application.Forms.AddEx(fcp);

MessageBox.Show("Error in testing" + ex.Message);

}

oForm.Top = 150;

oForm.Left = 330;

oForm.Visible = true;

}.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

Try This.......


try {
	System.Xml.XmlDocument oxmldoc = new System.Xml.XmlDocument();
	string spath = null;
	spath = System.IO.Directory.GetParent(Application.StartupPath).ToString();
	oxmldoc.Load(spath + "\\" + "test.xml");
	sbo_application.LoadBatchActions(oxmldoc.InnerXml);
} catch (Exception ex) {
	sbo_application.MessageBox(ex.Message);
}

Thanks

Shafi

former_member689126
Active Contributor
0 Kudos

Hi

while loading xml file specify the complete path instead of file name

string transTemp0 = "C:\test.xml";

Regards

Arun

Former Member
0 Kudos

Hi ,

it is not helping...

former_member689126
Active Contributor
0 Kudos

Hi

Try this

public Testing()
{

SAPbouiCOM.Form oForm = null;

 try
        {
            oForm = SBO_Application.Forms.Item("test");
            SBO_Application.MessageBox("Form Already Open", 1, "Ok", "", "");
        }
        catch (Exception ex)
        {

            string transTemp0 = "test.xml";
            LoadFromXML(ref transTemp0);

            MessageBox.Show("Error in testing" + ex.Message);
        }
        oForm = SBO_Application.Forms.Item("test");
        oForm.Top = 150;
        oForm.Left = 330;
        oForm.Visible = true;
}

Regards

Arun