Matrix DataSources
Hi,
I'm new to the SAP SDK and just trying to work thru some basics regarding the Matrix object.
I modified the Sales Order Form by adding a new Tab/Folder to it.
On that Tab, I added a 2 column matrix.
I added the system OCRD table as a DBDataSource to the form.
When I try to Bind the matrix columns to columns in the OCRD table, I get the following error.
ComException: Data Source - Not User Data Source.
Here's snippets of the code:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
' Add the DataSources to the Form
oForm.DataSources.DBDataSources.Add("OCRD")
' Use an existing item for placement
oItem = oForm.Items.Item("19")
' Matrix
oNewItem = oForm.Items.Add("NWMatrix",APbouiCOM.BoFormItemTypes.it_MATRIX)
oNewItem.Top = oItem.Top
oNewItem.Left = oItem.Left
oNewItem.FromPane = 5
oNewItem.ToPane = 5
oNewItem.Width = 400
oNewItem.Height = 100
oMatrix = oNewItem.Specific
oColumns = oMatrix.Columns
' Add the First Column
oColumn = oColumns.Add("Code", SAPbouiCOM.BoFormItemTypes.it_EDIT)
oColumn.TitleObject.Caption = "Customer ID"
oColumn.Editable = False
oColumn.Width = 100
' Add the Second Column
oColumn = oColumns.Add("Name", SAPbouiCOM.BoFormItemTypes.it_EDIT)
oColumn.TitleObject.Caption = "Customer Name"
oColumn.Editable = False
oColumn.Width = 100
oMatrix = oForm.Items.Item("NWMatrix").Specific
oColumns = oMatrix.Columns
oColumn = oColumns.Item("Code")
' Try to Set the Bind to the CardCode Field
' Error is thrown from this line
oColumn.DataBind.SetBound(True, "OCRD", "CardCode")
' get the datasource
oDBDataSource = oForm.DataSources.DBDataSources.Item("OCRD")
' Get the matrix
oMatrix = oForm.Items.Item("NWMatrix").Specific
oMatrix.Clear()
' Query the datasource
oDBDataSource.Query()
Dim i As Integer = 0
Do While i < (oDBDataSource.Size - 1)
oDBDataSource.Offset = i
oMatrix.AddRow()
i = i + 1
Loop
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
I'm unsure of why the error is coming up.
After reading the tutorials and documentation, from what I understand, a matrix is just a 2 dimensional data container.
Also, how do you use UserDataSources? Can you link to external tables, files, web services and have that data displayed within SAP matrix or Grids?
I see how to bind the UserDataSources, but where/how does the Addon figure out where to get that UserDataSource from just the line
oForm.DataSources.UserDataSources.Add("NWData", SAPbouiCOM.BoDataType.dt_LONG_TEXT, 50)??
Where do you specify where "NWData" is coming from?
Cheers,
Pete
Hi,
Following is the code which is used to link DB to matrix
<u> '// getting the matrix column by the UID
oColumn = oColumns.Item("DSCardCode")
'oColumn.DataBind.SetBound(True, "", "IntPhone")
oColumn.DataBind.SetBound(True, "OITM", "ITEMCODE")
oColumn = oColumns.Item("DSCardName")
'oColumn.DataBind.SetBound(True, "", "IntPhone")
oColumn.DataBind.SetBound(True, "OITM", "ITEMNAME")
oColumn = oColumns.Item("DSPhone")
oColumn.DataBind.SetBound(True, "", "IntPhone")
oColumn = oColumns.Item("DSPhoneInt")
oColumn.DataBind.SetBound(True, "", "IntPhone")
'oEditText.DataBind.SetBound(True, "", "EditSource")</u>
Similar Messages
-
DateField not getting copy in the matrix using Datasource & Datatable
Hello All,
I have tried to copy data From Purchase Order Tables to my own created User Defined Form matrix columns using DBDatasource & Datatables ,Instead of Document Date all other data are getting copied but that document date field is not
getting the data plus it is not showing any error message as such.
Following is the code which i have written :-
=====================================
oPurchase_Amend.DataSources.DataTables.Add("oMatrixDT" )
oPurchase_Amend.DataSources.DataTables.Item("oMatrixDT" ).Clear()
Dim sSQL As String = "SELECT T1.[ItemCode], T1.[Dscription], T1.[Quantity], T1.[Price],(Select InvntryUoM From OITM Where ItemCode=T1.ItemCode) as 'UoM',T1.LineNum,T0.DocNum as 'FrmDate' FROM OPOR T0 INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.[DocNum] ='1' and T0.CardCode='C0001'
oPurchase_Amend.DataSources.DataTables.Item("oMatrixDT" ).ExecuteQuery(sSQL)
oMatrix = oPurchase_Amend.Items.Item("mtx_0").Specific
oMatrix.Clear()
Dim oDBDataSource As SAPbouiCOM.DBDataSource = oPurchase_Amend.DataSources.DBDataSources.Item("@OSL_POAMD")
Dim oDataTable As SAPbouiCOM.DataTable = oPurchase_Amend.DataSources.DataTables.Item("oMatrixDT" )
oDBDataSource.Clear()
For row As Integer = 0 To oDataTable.Rows.Count - 1
Dim offset As Integer = oDBDataSource.Size
oDBDataSource.InsertRecord(row)
oDBDataSource.SetValue("U_ItemCode", offset, oDataTable.GetValue("ItemCode", row).ToString())
oDBDataSource.SetValue("U_ItemName", offset, oDataTable.GetValue("Dscription", row).ToString())
oDBDataSource.SetValue("U_UoM", offset, oDataTable.GetValue("UoM", row).ToString())
oDBDataSource.SetValue("U_OldQty", offset, oDataTable.GetValue("Quantity", row).ToString())
oDBDataSource.SetValue("U_OldRate", offset, oDataTable.GetValue("Price", row).ToString())
> Line For Copying Document Date Data to the matrix datasource
oDBDataSource.SetValue("U_OldDate", offset, oDataTable.GetValue("FrmDate", row))
oDBDataSource.SetValue("U_LineId", offset, oDataTable.GetValue("LineNum", row))
Next
'--- Rebinding the datasource to the matrix columns -
oMatrix.Columns.Item("col_0").DataBind.SetBound(True, "@OSL_POAMD", "U_ItemCode")
oMatrix.Columns.Item("col_1").DataBind.SetBound(True, "@OSL_POAMD", "U_ItemName")
oMatrix.Columns.Item("col_3").DataBind.SetBound(True, "@OSL_POAMD", "U_OldQty")
oMatrix.Columns.Item("col_5").DataBind.SetBound(True, "@OSL_POAMD", "U_OldRate")
oMatrix.Columns.Item("col_7").DataBind.SetBound(True, "@OSL_POAMD", "U_OldDate")
oMatrix.Columns.Item("col_9").DataBind.SetBound(True, "@OSL_POAMD", "U_LineId")
oMatrix.LoadFromDataSource()
But i am not able to get the document date in the column of the matrix .
Please suggest what changes i have to meke in this code to get the desired output.
Thanks & Regards,
Amit
Edited by: AmitSharma_061985 on Dec 17, 2009 12:24 PMHi Michael,
FrmDate is the Document date of the purchase order which i am fetching through sql query and trying to copy that in the matrix
through datasource .
Edited by: AmitSharma_061985 on Dec 18, 2009 7:07 AM -
Using a View as the DataSource for a Matrix
Does anyone know if it is possible to use a view as the datasource for a matrix? For example, I have created a view named 'VW1' with 4 columns (1 being ItemCode). Here is the code that tries to set this view as the datasource for a matrix:
tableName = "VW1";
dbDataSource = sboForm.DataSources.DBDataSources.Add(tableName);
// Add the bind columns
column = columns.Add(COL_VALUE_UID, SAPbouiCOM.BoFormItemTypes.it_EDIT);
column.DataBind.SetBound(true, tableName, "ItemCode");
This last line of this code hangs but if I put a try around it, the GetLastError does not return anything. Is it because views cannot be used as datasources or is there something else I am missing?Hi David,
You can use a view as a matrix datasource if you use UserDataSources instead of DBDataSources.
UserDataSource DSSubJobID = form.DataSources.UserDataSources.Add("SubJobID", SAPbouiCOM.BoDataType.dt_LONG_NUMBER, 12);
Col = GridMain.Columns.Item(ColSubJobID);
Col.DataBind.SetBound(true, "", DSSubJobID.UID);
You then need to manually set the value of the UserDataSource e.g:
Reader = Command.ExecuteReader(CommandBehavior.SequentialAccess);
GridMain.Clear();
int RowNo = 1;
while (Reader.Read())
DSSubJobID.Value = SubJobID.ToString();
//set other user datasources here
//add a row the matrix
GridMain.AddRow(1, -1);
Regards, Lita -
Hello Community
Using Visual Studio 2008 I have created a Windows Forms Application in which I created
Embedded Reports (rdlc).
The embedded reports (rdlc) uses Matrix(s).
Now on this one rdlc I have dragged 2 Matrix(s) onto the body.
One of the Matrix datasource dataset name and table name is "DataSet1_Table1.
A cells in the Matrix has a total column on the end as follows:
=FormatNumber(Sum(Fields!fld1.Value)+Sum(Fields!fld2.Value)+Sum(Fields!fld3.Value)+Sum(Fields!fld4.Value)+Sum(Fields!fld5.Value),"0")
The other Matrix datasource dataset name and table name is "DataSet2_Table2.
The cell in this Matrix has a total column on the end as follows:
=Sum(Fields!fld1.Value)+Sum(Fields!fld2.Value)+Sum(Fields!fld3.Value)+Sum(Fields!fld4.Value)+Sum(Fields!fld5.Value)
As you can see each Matrix has a different table.
I would like to add the total columns from each table in each Matrix but I haven't been
able to do it successfully. If I have to drag another Matrix or a Textbox on the
body to do it that is okay and/or add another/different formula to a cell onto the body that is
okay too.
So my question is how can I add the contents of the total in cell from each table in each matrix
which will create the "grand total"?
Thank you
ShabeautIt is possible to reference SSRS elements directly using the ReportItems collection. If your total tablix cell is outside of yoour matrix groups, you can use this collection to accomplish what you want:
=ReportItems!Matrix1Total.Value + ReportItems!Matrix2Total.Value
where Matrix1Total and Matrix2Total is the name of the cell that contains your totals. Note that for this to work, the cell name must be unique. If the total cell is inside a group, it will be repeated once for each instance of the group and will not be
unique.
You may be able to do it using the Sum aggregate and specifying the dataset for the scope variable:
=Sum(Fields!fld1.Value, "DataSet1")+Sum(Fields!fld2.Value,
"DataSet1")+Sum(Fields!fld3.Value,
"DataSet1")+Sum(Fields!fld4.Value,
"DataSet1")+Sum(Fields!fld5.Value,
"DataSet1")+Sum(Fields!fld1.Value,
"DataSet2")+Sum(Fields!fld2.Value,
"DataSet2")+Sum(Fields!fld3.Value,
"DataSet2")+Sum(Fields!fld4.Value,
"DataSet2")+Sum(Fields!fld5.Value,
"DataSet2")
This will work as long as you are not filtering the dataset in your Matrix properties. If you are, those
filters will not apply to this expression and the numbers will not total correctly.
"You will find a fortune, though it will not be the one you seek." -
Blind Seer, O Brother Where Art Thou
Please Mark posts as answers or helpful so that others may find the fortune they seek. -
UDO update in matrix with conditions deletes data
Hi,
I have a form binded to a MasterData and MasterDataLines tables.
I have three folders in this form.
When I click a folder I set a conditions to the matrix datasource so that I can see only the relevant data for each folder.
The problem is when I update.
The lines that are visible in the matrix are updated but the rest of it are deleted!
Any ideas in how can I update without loosing data?
Best Regards,
Ana SilvaHello Ana,
Try to debug your addon to determine the number of rows in the matrix by RowCount and VisualRowCount. If 2 numbers are differs, than do not flush the data before you sav action.
if the numbers are same, than i suggest to use the following procedure before saving:
0. filter matrix data by conditions (this is what you do)
1. press save
2. receive and load data has been filtered out (wich is not visible in edited mode)
3. flush to datasource
4. save the data by default udo process.
Regards
János -
Problem with Matrix/Checkbox/Datasource
Hi, i have a problem with a Matrix.
There are 3 Columns on this Matrix, one of those is a Checkbox. I fill the Columns with data, the Checkboxes where just added (no Checkbox is selected), the user has to select the value (Checkbox)he want's to by hand.
After i filled the Matrix i can see all the data on the Form, it's OK, but then i loose all entries after SBO is doing some work. There where shown only the empty rows and the checkboxes.
I guess it has something to do with the databinding. My problem is that i don't have the Data for this form on a db-table. I fill in the matrix the result of some querys. It looks like i need at least a DB-Field for the checkboxes, otherwise there are not working (not selectable)
Somebody knows a solution how i can keep the Data in the Matrix after SBO is doing some work? What could be the reason that i loose the data after filling it in the Matrix? Is there an easy way?
Thanks AndreasAlmost every item on a form need a datasource... If the item reprecents some data in a table the databinding must be a dbds... If the data does not reflect any data in a table (Calulated value, user-decision, ect.) a userdatasource need to be created...
Add a userdatasource
oForm.DataSources.UserDataSources.Add(UID,type,length);
Databind to DBDS
col.DataBind.SetBound(true,TABLE,FIELD);
Databind to UDS
col.DataBind.SetBound(true,,UID); -
Hi,
i created an empty matrix on a form and i am trying to fill data in it with recordset ans userdatsource.
I tested my recrdset query and it is working but my matrix want show me data when the form is loaded.
this is my code :
public static void FillUserDataSource()
Globals.TestRecordSet = (SAPbobsCOM.Recordset) Globals.company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
Globals.TestRecordSet.DoQuery(("SELECT DocNum,ORDR.CardCode,City FROM ORDR,OCRD WHERE ORDR.CardCode=OCRD.CardCode"));
if (Globals.TestRecordSet.RecordCount != 0)
Globals.TestRecordSet.MoveFirst();
while (!Globals.TestRecordSet.EoF)
for (int i = 0; i < 3; i++)
Globals.TestForm.DataSources.UserDataSources.Item(i).ValueEx = (string)Globals.TestRecordSet.Fields.Item(i).Value;
Globals.ComMatrix.AddRow(1,0);
Globals.TestRecordSet.MoveNext();
Thanks for your help.hi,
i tried your code and it is the same it wont display.
i ll show you all my code .
using System;
using System.Collections.Generic;
using System.Text;
namespace FormsTest
public class FormOp
public FormOp(string filename, string formid)
DrawForm(filename, formid);
AddDatasourceToForm();
DataBindToForm();
FillUserDataSource();
public static void DrawForm(string filename, string formid)
XmlOperations.LoadFromXml(filename);
try
Globals.TestForm = Globals.sboApplication.Forms.Item(formid);
catch (Exception e)
Globals.sboApplication.MessageBox(e.Message, 1, "OK", "", "");
Globals.TestItem = Globals.TestForm.Items.Item("dteliv");
Globals.DatLivText = (SAPbouiCOM.EditText)Globals.TestItem.Specific;
Globals.TestItem = Globals.TestForm.Items.Item("pcom");
Globals.PoidCom = (SAPbouiCOM.EditText)Globals.TestItem.Specific;
Globals.TestItem = Globals.TestForm.Items.Item("pcomrest");
Globals.PoidComRestant = (SAPbouiCOM.EditText)Globals.TestItem.Specific;
Globals.TestItem = Globals.TestForm.Items.Item("pchar");
Globals.PoidChar = (SAPbouiCOM.EditText)Globals.TestItem.Specific;
Globals.TestItem = Globals.TestForm.Items.Item("pcharrest");
Globals.PoidCharRestant = (SAPbouiCOM.EditText)Globals.TestItem.Specific;
Globals.TestItem = Globals.TestForm.Items.Item("matcom");
Globals.ComMatrix = (SAPbouiCOM.Matrix)Globals.TestItem.Specific;
Globals.TestItem = Globals.TestForm.Items.Item("matcom1");
Globals.Com1Matrix = (SAPbouiCOM.Matrix)Globals.TestItem.Specific;
Globals.TestItem = Globals.TestForm.Items.Item("matstock");
Globals.StockMatrix = (SAPbouiCOM.Matrix)Globals.TestItem.Specific;
Globals.TestItem = Globals.TestForm.Items.Item("matstock1");
Globals.Stock1Matrix = (SAPbouiCOM.Matrix)Globals.TestItem.Specific;
Globals.TestItem = Globals.TestForm.Items.Item("matveh");
Globals.VehiculMatrix = (SAPbouiCOM.Matrix)Globals.TestItem.Specific;
Globals.TestItem = Globals.TestForm.Items.Item("matveh1");
Globals.Vehicul1Matrix = (SAPbouiCOM.Matrix)Globals.TestItem.Specific;
Globals.TestItem = Globals.TestForm.Items.Item("creeliv");
Globals.CreerLiv = (SAPbouiCOM.Button)Globals.TestItem.Specific;
Globals.TestItem = Globals.TestForm.Items.Item("interr");
Globals.Interr = (SAPbouiCOM.Button)Globals.TestItem.Specific;
Globals.TestItem = Globals.TestForm.Items.Item("NComCol");
Globals.NComCol = (SAPbouiCOM.Column)Globals.TestItem.Specific;
Globals.TestItem = Globals.TestForm.Items.Item("NomClCol");
Globals.NomClCol = (SAPbouiCOM.Column)Globals.TestItem.Specific;
Globals.TestItem = Globals.TestForm.Items.Item("PoComCol");
Globals.PoComCol = (SAPbouiCOM.Column)Globals.TestItem.Specific;
Globals.TestItem = Globals.TestForm.Items.Item("VilLivCol");
Globals.VilLivCol = (SAPbouiCOM.Column)Globals.TestItem.Specific;
Globals.TestItem = Globals.TestForm.Items.Item("VolComCol");
Globals.VolComCol = (SAPbouiCOM.Column)Globals.TestItem.Specific;
public static void AddDatasourceToForm()
SAPbouiCOM.UserDataSource oUserDataSource;
oUserDataSource = Globals.TestForm.DataSources.UserDataSources.Add("ComDataSource", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 20);
public static void DataBindToForm()
Globals.NomClCol.DataBind.SetBound(true, "", "ComDataSource");
Globals.NomClCol.DataBind.SetBound(true, "", "ComDataSource");
Globals.VilLivCol.DataBind.SetBound(true, "", "ComDataSource");
Globals.PoComCol.DataBind.SetBound(true, "", "ComDataSource");
Globals.VolComCol.DataBind.SetBound(true, "", "ComDataSource");
public static void FillUserDataSource()
Globals.TestRecordSet = (SAPbobsCOM.Recordset)Globals.company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
Globals.TestRecordSet.DoQuery(("SELECT DocNum,ORDR.CardCode,City FROM ORDR,OCRD WHERE ORDR.CardCode=OCRD.CardCode"));
if (Globals.TestRecordSet.RecordCount != 0)
Globals.TestRecordSet.MoveFirst();
while (!Globals.TestRecordSet.EoF)
Globals.ComMatrix.AddRow(1, 0);
for (int i = 0; i < 3; i++)
Globals.TestForm.DataSources.UserDataSources.Item(i).ValueEx = (string)Globals.TestRecordSet.Fields.Item(i).Value;
Globals.ComMatrix.SetLineData(Globals.ComMatrix.RowCount);
Globals.TestRecordSet.MoveNext(); -
Rebinding datasource to system matrix
Hi,
is it possible in SBO to rebind in system form system matrix with another datasource? For example order items are shown in system matrix and I would like to bind this system item to my recordset.
The only solution I found is to hide all columns in matrix and add new columns bounded to my datasource, but this is not the best way. Any idea?
thx
PetrAs I found now, the way to add new columns isn`t working, because error "this item is not user defined item". Is any possibility to set the matrix as user matrix?
What I need is to keep the design and references from matrix, but change datasource to my datasource (I need to change some part of sql query). -
Order a datasource to load a binded matrix
Hello,
I want to load a matrix from a datasource. The problem is that I need the datasource ordered in a specific way.
¿Is it possible?
Thanks in advanceHi,
anything loaded from DBDataSource into matrix is ordered by Code. No matter what you do, it is loaded into matrix by primary key...
There's possibility, to create similiar userTable, with similiar userFields, and when loading the matrix, remove all items from it, and put there new items, which will be shown.
be carefull when creating the "code" column, because the matrix will be ordered by it ... so the entry with code 10, will be before 9, and so on ...
it's wise, to format Code in insert to more characters 8, and insert there zeroes ... thus 00000009 will be shown before 00000010 ...
... and ofcourse, when handling bigger tables, it is kinda slow
...and don't forget to change "source" table, instead the one, which is "shown" in matrix ...
Regards,
Jaro -
Hi,
I have been through all the Matrix Samples and read many threads here but I just dont get a few things with the Matrix.
I have created an add on that adds a new folder to the Business Partners Form,
I can have built a matrix in this form and created bound columns bound to my UDO Table @xxxx
I have an event that fires when a business partner is chosen and the folder is only shown when a Customer is selected.
I can even get the matrix to fill with data related to the specific customer only when the customer is selected - using conditions on the DBDataSource.
This is all great but the 2 problems I have are :
I have created a button called Add Row that Adds a Row to Matrix - this button turns into an Update button when the row is added in the Matrix.
Problem 1 : When the row is added in the Matrix it takes the data from the last row of the data and duplicates it in the new row - you can change this data of course however I would like a blank row inserted instead.
Problem 2 : When I update I do a Matrix.FlushToDataSource - then I requery but it has not saved the new entry ?
How do I get the new entry to save into the database.
Any Help would be appreciated.
ThanksThanks - I sent the Screen shot - here is the event code
If ((pVal.FormType = 134 And pVal.EventType <> SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD) And (pVal.Before_Action = True)) Then
oForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
If ((pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD) And (pVal.Before_Action = True)) Then
oNewItem = oForm.Items.Add("BOMFolder", SAPbouiCOM.BoFormItemTypes.it_FOLDER)
oItem = oForm.Items.Item("9")
oNewItem.Top = oItem.Top
oNewItem.Height = oItem.Height
oNewItem.Width = oItem.Width
oNewItem.Left = oItem.Left + oItem.Width
oFolderItem = oNewItem.Specific
oFolderItem.Caption = "Lynxs BOM"
oFolderItem.GroupWith("9")
SetupBOMMatrix()
oForm.PaneLevel = 1
End If
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
If pVal.ItemUID = "mat" Or pVal.ItemUID = "colitem" Then
Try
Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
oCFLEvento = pVal
Dim sCFL_ID As String
sCFL_ID = oCFLEvento.ChooseFromListUID
Dim oForm1 As SAPbouiCOM.Form
oForm1 = SBO_Application.Forms.Item(FormUID)
Dim oCFL As SAPbouiCOM.ChooseFromList
oCFL = oForm1.ChooseFromLists.Item(sCFL_ID)
If oCFLEvento.BeforeAction = False Then
Dim oDataTable As SAPbouiCOM.DataTable
oDataTable = oCFLEvento.SelectedObjects
Dim val As String
Dim nam As String
Try
val = oDataTable.GetValue(0, 0)
nam = oDataTable.GetValue(1, 0)
Catch ex As Exception
val = "none"
nam = "none"
End Try
Try
Call UpdateCells(oForm1, pVal.Row, val, nam)
Catch
MsgBox("Couldnt Set Data Tables")
End Try
End If
Catch
MsgBox("Error in Item Event - CFL : " & Err.Description)
End Try
End If
End If
If pVal.ItemUID = "btnAddRow" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And pVal.Before_Action = True Then
' SOMETHING IS AMISS HERE
Dim ob As SAPbouiCOM.Button = oForm.Items.Item("btnAddRow").Specific
Dim oe As SAPbouiCOM.EditText = oForm.Items.Item("5").Specific
oMatrix = oForm.Items.Item("mat").Specific
If MatrixMode = "Nothing" Then
oMatrix.AddRow()
Dim i As Integer
i = oMatrix.RowCount
Dim oc As SAPbouiCOM.Column
Dim ocell As SAPbouiCOM.Cell
Dim oed As SAPbouiCOM.EditText
oc = oMatrix.Columns.Item("colArea")
oed = oc.Cells.Item(i).Specific
oed.String = ""
oc = oMatrix.Columns.Item("colItem")
oed = oc.Cells.Item(i).Specific
oed.String = ""
oc = oMatrix.Columns.Item("colItemtxt")
oed = oc.Cells.Item(i).Specific
oed.String = ""
oc = oMatrix.Columns.Item("colFitted")
oed = oc.Cells.Item(i).Specific
oed.Value = 0
oc = oMatrix.Columns.Item("colCritica")
oed = oc.Cells.Item(i).Specific
oed.Value = 0
oc = oMatrix.Columns.Item("colSpares")
oed = oc.Cells.Item(i).Specific
oed.Value = 0
MatrixMode = "Add"
ob.Caption = "Update Row"
Else
oMatrix.FlushToDataSource()
Dim oConditions As SAPbouiCOM.Conditions
Dim ocondition As SAPbouiCOM.Condition
oConditions = New SAPbouiCOM.Conditions
ocondition = oConditions.Add
ocondition.BracketOpenNum = 1
ocondition.Alias = "U_CARDCODE"
ocondition.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
ocondition.CondVal = oe.Value.ToString
ocondition.BracketCloseNum = 1
oDBDatasource.Query(oConditions)
oMatrix.LoadFromDataSource()
MatrixMode = "Nothing"
ob.Caption = "Add Row"
End If
End If
If pVal.ItemUID = "BOMFolder" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And pVal.Before_Action = True Then
'// when the new folder is clicked change the form's pane level
'// by doing so your items will apear on the new folder
'// assuming they were placed correctly and their pane level
'// was also set accordingly
oForm.PaneLevel = 11
End If
End If -
Can you help me to solve this matrix filling problem?
Hi,
I need to fill a matrix column. this is the description briefly.
1.This is my binding
oForm.DataSources.UserDataSources.Add("usr_col5", SAPbouiCOM.BoDataType.dt_DATE, 50);
oColumn = oColumns.Add("Col5", SAPbouiCOM.BoFormItemTypes.it_EDIT);
oColumn.Description = "Konteringsdato";
oColumn.TitleObject.Caption = "Konteringsdato";
oColumn.DataBind.SetBound(true, "", "usr_col5");
oColumn.Width = 89;
oColumn.Editable = false;
2.I am going to fill this column using record set's field. all of the other column's fillings are ok.but problem is here
oForm.DataSources.UserDataSources.Item("usr_col5").Value = oRs.Fields.Item("DocDate").Value.ToString();
I think there should be a casting instead of of using ToString(). But i couldn't able to do it. So please help me.Hi,
you can try once to set
((SAPbouiCOM.EditText)((SAPbouiCOM.Matrix)(oForm.Items.Item("mtxItemUID").Specific)).Columns.Item("Col5").Cells.Item(cellnumber).Specific).String = oRs.Fields.Item("DocDate").Value.ToString();
or
((SAPbouiCOM.EditText)((SAPbouiCOM.Matrix)(oForm.Items.Item("mtxItemUID").Specific)).Columns.Item("Col5").Cells.Item(cellnumber).Specific).Value = oRs.Fields.Item("DocDate").Value.ToString();
regards
David -
Display data to matrix using LoadFromDataSource
Hello all,
I tried to display data to matrix.
I used matrix object's LoadFromDatasouce.
But it didn't display data at all.
Pls help me!!
creationPackage.ObjectType = "EVOSS_BUSTR"
creationPackage.UniqueID = "TEST
creationPackage.FormType = "TEST"
creationPackage.BorderStyle = SAPbouiCOM.BoFormTypes.ft_Fixed
Set oForm = SBO_Application.Forms.AddEx(creationPackage)
sTableName = "@EVOSS_BUSTR"
oForm.Title = sTitle
oForm.Height = 300
oForm.Width = 350
oForm.DataSources.DBDataSources.Add ("sTableName")
Set oItem = oForm.Items.Add("1", it_BUTTON)
oItem.Left = 5
oItem.Width = 65
oItem.Top = 240
oItem.Height = 19
Set oButton = oItem.Specific
oButton.Type = bt_Caption
Set oItem = oForm.Items.Add("2", it_BUTTON)
oItem.Left = 75
oItem.Width = 65
oItem.Top = 240
oItem.Height = 19
Set oButton = oItem.Specific
oButton.Type = bt_Caption
'Adding a matrix
Set oItem = oForm.Items.Add("TEST, it_MATRIX)
oItem.Left = 5
oItem.Width = 340
oItem.Top = 10
oItem.Height = 200
oItem.AffectsFormMode = True
Set oMatrix = oItem.Specific
Set oColumns = oMatrix.Columns
'Adding col 1
Set oColumn = oColumns.Add("ColNb", it_EDIT)
oColumn.TitleObject.Caption = "#"
oColumn.Width = 20
oColumn.Editable = False
'oColumn.DataBind.SetBound True, "", "#"
'Adding col 2
Set oColumn = oColumns.Add("EVOSS_Code", it_EDIT)
oColumn.TitleObject.Caption = "Code"
oColumn.Width = 80
oColumn.Editable = True
oColumn.DataBind.SetBound True, sTableName, "Code"
'Adding col 3
Set oColumn = oColumns.Add("EVOSS_Name", it_EDIT)
oColumn.TitleObject.Caption = "Name"
oColumn.Width = 220
oColumn.Editable = True
oColumn.DataBind.SetBound True, sTableName, "Name"
oMatrix.AddRow
Set oColumn = oMatrix.Columns.Item("EVOSS_Code")
Set eItemCode = oColumn.Cells.Item(1).Specific
' oForm.Mode = fm_FIND_MODE
' oForm.DataBrowser.BrowseBy = "EVOSS_Code"
'oMatrix.SelectionMode = ms_None
oForm.Visible = True
add_line = True
oMatrix.LoadFromDataSourceHello.
For load a data to a matrix you need call a Query method of the dbdatasource to obtain data from the database.
By. -
Adding data from one matrix to another
Hay guys.I'm having trouble with adding data, that is situated in a Matrix on form A and bound to a userdatasource,
to a Matrix on form B that is bound to a dbdatasource.
For some reason the data either does not display at all, or it only displays the last records' data as many times
as there are records in the original matrix from form A.
Here's the code I've tried: (Displays only last record x times)
For i = 1 To oMatrixSync.RowCount
oFormTime.DataSources.DBDataSources.Item("@TB_TIMEDET").SetValue("U_Activity", _
oMatrixTime.RowCount, _
oFormSync.DataSources.UserDataSources.Item("U_Act").ValueEx)
oMatrixTime.AddRow()
next
And this code displays zip:
For i = 1 To oMatrixSync.RowCount
oCheckBox = oMatrixSync.Columns.Item("c_Check").Cells.Item(i).Specific
If oCheckBox.Checked = True Then
oEditS = oMatrixSync.Columns.Item("c_Activity").Cells.Item(i).Specific
oFormTime.DataSources.DBDataSources.Item("@TB_TIMEDET").SetValue("U_Activity", _
oMatrixTime.RowCount, _
oEditS.Value)
oMatrixTime.AddRow()
oMatrixTime.LoadFromDataSource()
next
Any help would be greatly appreciated, thanx all!
Message was edited by: Tjaard Du PlessisThanks, Jaro!
You are right. The code should look like this:
Dim oDBDSTime As DBDataSource = oFormTime.DataSources.DBDataSources.Item("@TB_TIMEDET")
Dim oUDSSync As UserDataSource = oFormSync.DataSources.UserDataSources.Item("U_Act")
For i = 1 To oMatrixSync.RowCount
oMatrixSync.GetLineData(i)
oDBDSTime.InsertRecord(i)
oDBDSTime.SetValue("U_Activity", _
i, _
oUDSSync.ValueEx)
Next
oMatrixTime.LoadFromDataSource()
Regards,
Frank -
How To hide a column on a Matrix using a parameter that is set-up as a multi-select
Hi,
I have a multi-select parameter (has 4 choices ie. A,B,C,D). In the matrix the parent Column group is a date and the child group is based on the Multi-select parameter field. When all choices are selected the report returns a column per
date and then within that date column 4 sub columns as expected.....This all works.
Challenge ... I added another column (Col5). For Col5 I only want it to show if value B has been selected from the multi choice
Another way of saying it.... How do I get a column to appear (Visibility) if a specific Value has been select in a multi-choice parameter
Tx
Andrew
Andrew PayzeHi,
here is the query
SELECT ProjectNumber, ProjectDescription, WBS, TaskNumber, TaskName, TaskDescription, TaskManager, Results, ResourceExpenditure, CostSet, Currency,
ReportingDate, Value, YEAR(ReportingDate) AS Year, { fn MONTHNAME(ReportingDate) } AS Month, ActualValue, PriorEAC
FROM vwForecastAccuracy
WHERE (CostSet IN (@CostType)) AND (YEAR(ReportingDate) = @Year) AND (Results = 'Cost')
below is the Code, not sure how to attach RDL
Thanks
Andrew
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<Body>
<ReportItems>
<Tablix Name="matrix1">
<TablixCorner>
<TablixCornerRows>
<TablixCornerRow>
<TablixCornerCell>
<CellContents>
<Textbox Name="textbox3">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Style>
<FontFamily>Tahoma</FontFamily>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>textbox3</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCornerCell>
</TablixCornerRow>
<TablixCornerRow>
<TablixCornerCell>
<CellContents>
<Textbox Name="Textbox8">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Style>
<FontFamily>Tahoma</FontFamily>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox8</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCornerCell>
</TablixCornerRow>
</TablixCornerRows>
</TablixCorner>
<TablixBody>
<TablixColumns>
<TablixColumn>
<Width>1in</Width>
</TablixColumn>
<TablixColumn>
<Width>1in</Width>
</TablixColumn>
</TablixColumns>
<TablixRows>
<TablixRow>
<Height>0.21in</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="Value">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Sum(Fields!Value.Value)</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<Format>'$'#,0;('$'#,0)</Format>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Value</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
<rd:FormatSymbolCulture>en-US</rd:FormatSymbolCulture>
</Style>
</Textbox>
</CellContents>
<DataElementOutput>Output</DataElementOutput>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox4">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=RunningValue(Fields!ActualValue.Value,sum, "matrix1_ProjectNumber")</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox4</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
<DataElementOutput>Output</DataElementOutput>
</TablixCell>
</TablixCells>
</TablixRow>
</TablixRows>
</TablixBody>
<TablixColumnHierarchy>
<TablixMembers>
<TablixMember>
<Group Name="matrix1_ReportingDate">
<GroupExpressions>
<GroupExpression>=Fields!ReportingDate.Value</GroupExpression>
</GroupExpressions>
</Group>
<SortExpressions>
<SortExpression>
<Value>=Fields!ReportingDate.Value</Value>
</SortExpression>
</SortExpressions>
<TablixHeader>
<Size>0.21in</Size>
<CellContents>
<Textbox Name="Month">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Month.Value</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<FontWeight>Bold</FontWeight>
<Format>MM/dd/yyyy</Format>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Month</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#6e9eca</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixHeader>
<TablixMembers>
<TablixMember>
<Group Name="CostSet">
<GroupExpressions>
<GroupExpression>=Fields!CostSet.Value</GroupExpression>
</GroupExpressions>
</Group>
<SortExpressions>
<SortExpression>
<Value>=Fields!CostSet.Value</Value>
</SortExpression>
</SortExpressions>
<TablixHeader>
<Size>0.25in</Size>
<CellContents>
<Textbox Name="CostSet1">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!CostSet.Value</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<FontWeight>Bold</FontWeight>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>CostSet1</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#6e9eca</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixHeader>
<TablixMembers>
<TablixMember />
<TablixMember />
</TablixMembers>
</TablixMember>
</TablixMembers>
<DataElementOutput>Output</DataElementOutput>
<KeepTogether>true</KeepTogether>
</TablixMember>
</TablixMembers>
</TablixColumnHierarchy>
<TablixRowHierarchy>
<TablixMembers>
<TablixMember>
<Group Name="matrix1_ProjectNumber">
<GroupExpressions>
<GroupExpression>=Fields!ProjectNumber.Value</GroupExpression>
</GroupExpressions>
</Group>
<SortExpressions>
<SortExpression>
<Value>=Fields!ProjectNumber.Value</Value>
</SortExpression>
</SortExpressions>
<TablixHeader>
<Size>1in</Size>
<CellContents>
<Textbox Name="ProjectNumber">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!ProjectNumber.Value</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<FontWeight>Bold</FontWeight>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>ProjectNumber</rd:DefaultName>
<ActionInfo>
<Actions>
<Action>
<Drillthrough>
<ReportName>BUDVAR 11 Budget Detail By WBS</ReportName>
<Parameters>
<Parameter Name="ProjectNumber">
<Value>=Fields!ProjectNumber.Value</Value>
</Parameter>
<Parameter Name="Year">
<Value>=Parameters!Year.Value</Value>
</Parameter>
<Parameter Name="CostSet">
<Value>=Parameters!CostType.Value</Value>
</Parameter>
</Parameters>
</Drillthrough>
</Action>
</Actions>
</ActionInfo>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#6e9eca</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixHeader>
<DataElementOutput>Output</DataElementOutput>
<KeepTogether>true</KeepTogether>
</TablixMember>
</TablixMembers>
</TablixRowHierarchy>
<RepeatColumnHeaders>true</RepeatColumnHeaders>
<RepeatRowHeaders>true</RepeatRowHeaders>
<DataSetName>BudgetData</DataSetName>
<Height>0.67in</Height>
<Width>3in</Width>
<Style />
</Tablix>
</ReportItems>
<Height>0.84708in</Height>
<Style />
</Body>
<Width>3.85417in</Width>
<Page>
<LeftMargin>1in</LeftMargin>
<RightMargin>1in</RightMargin>
<TopMargin>1in</TopMargin>
<BottomMargin>1in</BottomMargin>
<Style />
</Page>
<AutoRefresh>0</AutoRefresh>
<DataSources>
<DataSource Name="BIDatabase">
<DataSourceReference>VSPDEV011</DataSourceReference>
<rd:SecurityType>None</rd:SecurityType>
<rd:DataSourceID>f3bf5788-4fb5-4822-89d9-2f4518f5488d</rd:DataSourceID>
</DataSource>
</DataSources>
<DataSets>
<DataSet Name="BudgetData">
<Query>
<DataSourceName>BIDatabase</DataSourceName>
<QueryParameters>
<QueryParameter Name="@CostType">
<Value>=Parameters!CostType.Value</Value>
</QueryParameter>
<QueryParameter Name="@Year">
<Value>=Parameters!Year.Value</Value>
</QueryParameter>
</QueryParameters>
<CommandText>SELECT ProjectNumber, ProjectDescription, WBS, TaskNumber, TaskName, TaskDescription, TaskManager, Results, ResourceExpenditure, CostSet, Currency,
ReportingDate, Value, YEAR(ReportingDate) AS Year, { fn MONTHNAME(ReportingDate) } AS Month, ActualValue, PriorEAC
FROM vwForecastAccuracy
WHERE (CostSet IN (@CostType)) AND (YEAR(ReportingDate) = @Year) AND (Results = 'Cost')</CommandText>
</Query>
<Fields>
<Field Name="ProjectNumber">
<DataField>ProjectNumber</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="ProjectDescription">
<DataField>ProjectDescription</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="WBS">
<DataField>WBS</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="TaskNumber">
<DataField>TaskNumber</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="TaskName">
<DataField>TaskName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="TaskDescription">
<DataField>TaskDescription</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="TaskManager">
<DataField>TaskManager</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Results">
<DataField>Results</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="ResourceExpenditure">
<DataField>ResourceExpenditure</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="CostSet">
<DataField>CostSet</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Currency">
<DataField>Currency</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="ReportingDate">
<DataField>ReportingDate</DataField>
<rd:TypeName>System.DateTime</rd:TypeName>
</Field>
<Field Name="Value">
<DataField>Value</DataField>
<rd:TypeName>System.Decimal</rd:TypeName>
</Field>
<Field Name="Year">
<DataField>Year</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="Month">
<DataField>Month</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="ActualValue">
<DataField>ActualValue</DataField>
<rd:TypeName>System.Decimal</rd:TypeName>
</Field>
<Field Name="PriorEAC">
<DataField>PriorEAC</DataField>
<rd:TypeName>System.Decimal</rd:TypeName>
</Field>
</Fields>
</DataSet>
<DataSet Name="ProjectLookup">
<Query>
<DataSourceName>BIDatabase</DataSourceName>
<CommandText>SELECT DISTINCT ProjectNumber, ProjectDescription, ProjectNumber AS Expr1
FROM vwForecastAccuracy</CommandText>
</Query>
<Fields>
<Field Name="ProjectNumber">
<DataField>ProjectNumber</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="ProjectDescription">
<DataField>ProjectDescription</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Expr1">
<DataField>Expr1</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
</DataSet>
<DataSet Name="CostTypeLookup">
<Query>
<DataSourceName>BIDatabase</DataSourceName>
<CommandText>SELECT DISTINCT CostSet, CostSet AS CostSetDesc
FROM vwForecastAccuracy
UNION
SELECT NULL AS Expr1, 'All' AS CostSetDesc
ORDER BY CostSet</CommandText>
</Query>
<Fields>
<Field Name="CostSet">
<DataField>CostSet</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="CostSetDesc">
<DataField>CostSetDesc</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
</DataSet>
<DataSet Name="YearLookup">
<Query>
<DataSourceName>BIDatabase</DataSourceName>
<CommandText>SELECT DISTINCT YEAR(ReportingDate) AS Year
FROM vwForecastAccuracy
ORDER BY Year</CommandText>
</Query>
<Fields>
<Field Name="Year">
<DataField>Year</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
</Fields>
</DataSet>
</DataSets>
<ReportParameters>
<ReportParameter Name="Year">
<DataType>String</DataType>
<Prompt>Year</Prompt>
<ValidValues>
<DataSetReference>
<DataSetName>YearLookup</DataSetName>
<ValueField>Year</ValueField>
<LabelField>Year</LabelField>
</DataSetReference>
</ValidValues>
</ReportParameter>
<ReportParameter Name="CostType">
<DataType>String</DataType>
<Prompt>Cost Set</Prompt>
<ValidValues>
<DataSetReference>
<DataSetName>CostTypeLookup</DataSetName>
<ValueField>CostSet</ValueField>
<LabelField>CostSetDesc</LabelField>
</DataSetReference>
</ValidValues>
<MultiValue>true</MultiValue>
</ReportParameter>
</ReportParameters>
<Language>en-US</Language>
<ConsumeContainerWhitespace>true</ConsumeContainerWhitespace>
<rd:ReportUnitType>Inch</rd:ReportUnitType>
<rd:ReportID>19da6d82-a69b-4bb7-a634-2fee3191c5d8</rd:ReportID>
</Report>
Andrew Payze -
Problem in AddRow button and Matrix
Hello everybody...
Can anybody tell me...in my UDO Form AddRow button, matrix is not working...dont understand why???
But Add and Cancel buttons are working fine...there is no problem in code still I am not able to update values using Matrix...
See the code below...
Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
Try
' Events of the Blanket Agreement form
If (FormUID = "FBLK") Then
If (pVal.Before_Action = False) Then
' Click on Add Row
If (pVal.ItemUID = "AddRow") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) Then
Dim f As SAPbouiCOM.Form
Dim oMatrix As SAPbouiCOM.Matrix
f = SBO_Application.Forms.Item(FormUID)
oMatrix = f.Items.Item("mat").Specific
f.DataSources.DBDataSources.Item(1).Clear()
oMatrix.AddRow(1)
End If
End If
End If
Catch ex As Exception
MessageBox.Show(u2018not workingu2019)
End Try
End Sub
Please tell me where I am wrong...
Thanks in advanceHi Satish,
Thanks for the reply and yes I am using SetFilters and Item Uid is also correct, i have checked....
See Code below for SetFilters()
Private Sub SetFilters()
'// Create a new EventFilters object
oFilters = New SAPbouiCOM.EventFilters
'// add an event type to the container
'// this method returns an EventFilter object
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED)
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_COMBO_SELECT)
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_VALIDATE)
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_LOST_FOCUS)
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_KEY_DOWN)
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_MENU_CLICK)
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_CLICK)
'// assign the form type on which the event would be processed
oFilter.AddEx("149") 'Quotation Form
oFilter.AddEx("139") 'Orders Form
oFilter.AddEx("133") 'Invoice Form
oFilter.AddEx("169") 'Main Menu
SBO_Application.SetFilter(oFilters)
End Sub
Now tell me where I am wrong...
Maybe you are looking for
-
Problem in automatic PO creation after EHP4 upgrade
Hi experts, We upgraded our system from ECC6.0 to ehp4. When I am trying to use ME59n to create a PO automatically from a PR, I get a dump "Please maintain services or limits". Item category used is either 'B' or 'D'. The same was working fine earl
-
How can I make floating options windows behave like probe windows in LV 5.0?
Hello all, I'm trying to use subVI's as small floating windows that appear and disappear on command. These windows provide access to controls that trigger functions in the calling VI. I've already achieved this by calling the subVI's (which are set t
-
Ipod (3rd gen.) does not mount to iTunes
My ipod (3rd gen.) does not mount on iTunes (using a Mac). When plugged in, it appears on my desktop as if it were a jump drive. I was planning on re-formatting it with Disk Utility but I'm not sure if this is a good idea. I also realised that the
-
What is the best way to go about getting a wireless connection on the go?
Im new to the aple product. I just recently bought a New Macbook Pro and wanted to know what is the best way to go about connecting to the internet while not at home and on the go. I was thinking of maybe a USB internet stick. But dont know who provi
-
Hello All, We are trying to add an iFrame to a Custom WebCenter Portal page which also has an af:tree component. We are adding the iFrame through the f:verbatim route <h5> <f:verbatim rendered="true"> <iframe name="formsLauncher" width="5" height="5"