on 04-26-2011 7:44 AM
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;
}.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
while loading xml file specify the complete path instead of file name
string transTemp0 = "C:\test.xml";
Regards
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
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.