on 2011 Oct 26 2:37 PM
Hi all,
As I am new in SBO world, I'm trying to change a form adding a new tab with a new matrix. Well, I have a problem when I try to bind my Matrix with data from SBO database.
The code line "oMatrix.LoadFromDataSource();" get the following error:
{System.Runtime.InteropServices.COMException (0x80010105): The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
at SAPbouiCOM.IMatrix.LoadFromDataSource()
at SysForm.SystemForm.AddItemsToTESTE(ItemEvent pVal) in C:Program FilesSAPSAP Business One SDKSamplesCOM UICSharp11.SystemFormManipulationSystemForm.cs:line 289}
Here is my code:
SAPbouiCOM.IColumn oColumn = null;
SAPbouiCOM.DBDataSource oDBDataSource;
SAPbouiCOM.DBDataSource oDBDataSource1;
SAPbouiCOM.DBDataSource oDBDataSource2;
SAPbouiCOM.DBDataSource oDBDataSource3;
SAPbouiCOM.IItem ioItem;
SAPbouiCOM.Matrix oMatrix;
oDBDataSource = oOrderForm.DataSources.DBDataSources.Add("AITM");
oItem = oOrderForm.Items.Item("38");
ioItem = oOrderForm.Items.Add("Matrix", SAPbouiCOM.BoFormItemTypes.it_MATRIX);
ioItem.Left = oItem.Left;
ioItem.Top = oItem.Top + 50;
ioItem.Height = oItem.Height - 50;
ioItem.Width = oItem.Width;
ioItem.FromPane = 101;
ioItem.ToPane = 101;
oMatrix = ((SAPbouiCOM.Matrix)(ioItem.Specific));
oMatrix.Layout = SAPbouiCOM.BoMatrixLayoutType.mlt_Normal;
oMatrix.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Auto;
oColumn = oMatrix.Columns.Add("col0", SAPbouiCOM.BoFormItemTypes.it_EDIT);
oColumn.Editable = false;
oColumn.ForeColor = 1;
oColumn.TitleObject.Caption = "#";
oColumn = oMatrix.Columns.Add("CardCode", SAPbouiCOM.BoFormItemTypes.it_EDIT);
oColumn.Width = 30;
oColumn.Description = "col1";
oColumn.TitleObject.Caption = "Código";
oColumn.DisplayDesc = false;
oColumn.DataBind.SetBound(true, "AITM", "ItemCode");
oColumn = oMatrix.Columns.Add("ItemCode", SAPbouiCOM.BoFormItemTypes.it_EDIT);
oColumn.Width = 30;
oColumn.Description = "col2";
oColumn.TitleObject.Caption = "Nome";
oColumn.DisplayDesc = false;
oColumn.DataBind.SetBound(true, "AITM", "ItemName");
oMatrix.Clear();
oMatrix.AutoResizeColumns();
oDBDataSource.Query(null);
oMatrix.LoadFromDataSource();
--
Thanks for your response,
Best regards,
Joana Silva
Request clarification before answering.
What is your target to accomplish?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joana Silva,
Welcome you post on the forum.
Are you trying to bind CardCode with AITM.ItemCode and ItemCode with AITM.ItemName? That is not possible.
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
39 | |
8 | |
4 | |
3 | |
3 | |
3 | |
3 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.