Matrix with ComboBox Column
I want to make matrix with combobox column, it is not dificulte, but did somebody know is it posible with different values in each cell?
first row ( 0, Zero ), ( 1, One )
second row ( 0, Zero ), (2, Two ), (6, Six)
third row ( 0, Zero), (1, One )
.... ( Value, Description )
I make something but all cell's have the same set of pair (Value, Description )
P.S. Sorry for my english
Hi Andy,
I have been playing around with this for a while now and (seeing that Ibai actually already gave you a solution) I'm just gonna post where I am up to now. I have a matrix with two columns on it (c_1 and c_2). c_1 holds the value 1, 2 or 3. Whenever the user clicks on c_2 I repopulate the combo box according to the value selected in c_1. The only problem is that it shows the second last selected row and not the one that is currently selected. I am just posting it here so it can maybe someday put someone onto the right track.
If pVal.FormTypeEx = "MainForm" Then
If pVal.ItemUID = "m_List" Then 'Matrix
If pVal.ColUID = "c_2" Then 'Column 2
If pVal.BeforeAction = False Then
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_GOT_FOCUS Then
Dim oForm As SAPbouiCOM.Form
Dim oEdit As SAPbouiCOM.EditText
Dim oCombo As SAPbouiCOM.ComboBox
Dim oMatrix As SAPbouiCOM.Matrix
Dim oCol As SAPbouiCOM.Column
Dim i As Integer
oForm = oApplication.Forms.ActiveForm
oMatrix = oForm.Items.Item("m_List").Specific
oCol = oMatrix.Columns.Item("c_1")
oEdit = oCol.Cells.Item(pVal.Row).Specific
oCol = oMatrix.Columns.Item("c_2")
oCombo = oCol.Cells.Item(pVal.Row).Specific
For i = oCombo.ValidValues.Count - 1 To 0 Step -1
oCombo.ValidValues.Remove(i, SAPbouiCOM.BoSearchKey.psk_Index)
Next
If oEdit.Value = "1" Then
oCombo.ValidValues.Add("1", "One")
ElseIf oEdit.Value = "2" Then
oCombo.ValidValues.Add("2", "Two")
oCombo.ValidValues.Add("22", "TwoTwo")
ElseIf oEdit.Value = "3" Then
oCombo.ValidValues.Add("3", "Three")
oCombo.ValidValues.Add("33", "ThreeThree")
oCombo.ValidValues.Add("333", "ThreeThreeThree")
End If
End If
End If
End If
End If
End If
Hope it helps,
Adele
PS: Ibai, why do you have a new user name? You are the same Ibai Peña right?
Similar Messages
-
Data of matrix(with userdatasource columns) dissapear in form_add mode
Hi all,
Why when i put the mode of my userform in ADD_mode the data of my matrix (with userdatasource data in columns,not linked to one table) disapear?.
How i can do to not lost data? Exist any way?
Thank you all again.
Regards.Aitor,
I guess you are using UDO, and set it the ObjectType to form.
It is a default behavior that B1 will clear the form for new entry, when it switchs to add mode.
Would you specify the scenario more? Why would you like to keep the data in the form from Find / OK to Add mode?
Kind Regards
-Yatsea -
SSRS Matrix with customized column
I need to create a report in SSRS 2008. it's in the matrix format, but instead of normal columns that grows to the right, they want something like stepped rows only for column
Something like this:
col1
col2
col3
row1
row2
row3
instead of the standard matrix
col1 col2 col3
row1
row2
row3
Can anyone suggest to me how to do this?
Thanks!
EDIT: I include an url that hopefully help to clarify things a bit. I basically need to create a report in SSRS that resemble this below:
(sorry, unable to include image yet since I'm a new member)
http://imageshack.com/a/img633/7375/JB1wPE.jpgHi Daniel,
According to your description, you create a matrix in SSRS 2008. Then you want to make columns grows with step-shape.
In Reporting Services, dynamic column headers expand horizontally in a matrix. All the column headers can only be within one row. It’s not supported to put headers into different rows. However, we can make each column header displays in different positions
of a text box, then make it look like step-shape. As we tested in our environment, we set expression for column group like bellow:
=Switch(Fields!ID.Value="P01","P01"&chr(10)&chr(10),Fields!ID.Value="P02",chr(10)&"P02"&chr(10),Fields!ID.Value="P03",chr(10)&chr(10)&"P03")
Then we can get step-shape column headers.
Reference:
Adding a Matrix (Report Builder 2.0)
If you have any question, please feel free to ask.
Best regards,
Qiuyun Yu -
Matrix with Info Columns from different Table
Hi, how can i manage to have a column in a matrix that doesn't represent a value of the table the other columns are using?
For example, i have a matrix and this matrix has values of the UDT (@Table) and one column contains the projectcode. now i want one column in my matrix to show the project name of the OPRJ. how can i manage that, so that the value of this column in the matrix changes when i change the value of the other column with the project code?
best regards
PhilippHi
1) You can fill the matrix from Recordset.
For example: UDT is [@O01_USERTABLE].
PrjCode foreign key to the Projects table (OPRJ - not exposed through the DI API).
So, if you type correctly PrjCode, you can fetch description using method below.
Dim sSql As String = ""
sSql = " SELECT U.PrjCode AS PrjCode, S.PrjName As PrjName" & _
" FROM [@O01_USERTABLE] AS U, OPRJ AS S" & _
" WHERE U.PrjCode = S.PrjCode"
oRS = SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
oRS.DoQuery(sSql)
If oRS.RecordCount > 0 Then
Dim i As Integer = 0
oRS.MoveFirst()
While oRS.EoF = False
i = i + 1
oForm.DataSources.UserDataSources.Item("uNr").Value = i ' 1" matrix column for row number
oForm.DataSources.UserDataSources.Item("uPrjCode").Value = oRS.Fields.Item("PrjCode").Value
oForm.DataSources.UserDataSources.Item("uPrjName").Value = oRS.Fields.Item("PrjName").Value
oMatrix.AddRow()
oRS.MoveNext()
End While
End If
2) On ManageDataEvent, call Matrix_FetchDescriptions(...)
Public Sub ManageDataEvent(ByRef BusinessObjectInfo As SAPbouiCOM.BusinessObjectInfo, ByRef BubbleEvent As Boolean)
Dim oForm As SAPbouiCOM.Form = SBO_Application.Forms.Item(BusinessObjectInfo.FormUID)
If BusinessObjectInfo.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD Then
If Not BusinessObjectInfo.BeforeAction Then
Try
oForm.Freeze(True)
Dim oMatrix As SAPbouiCOM.Matrix
oMatrix = oForm.Items.Item("mtx00").Specific
If oMatrix.RowCount > 0 Then
Call Matrix_FetchDescriptions(oForm, -1)
End If
Catch ex As Exception
Finally
oForm.Freeze(False)
oForm.Update()
End Try
End If
End If
oForm = Nothing
End Sub
' Update column Name
Private Sub Matrix_FetchDescriptions(ByRef oForm As SAPbouiCOM.Form, ByVal iRow As Integer)
Dim oMatrix As SAPbouiCOM.Matrix
Dim oColumn As SAPbouiCOM.Column
Dim oCell As SAPbouiCOM.Cell
Dim oEdit As SAPbouiCOM.EditText
Try
If SBO_Company.Connect Then
oMatrix = oForm.Items.Item("mtx00").Specific
If oMatrix Is Nothing Then Throw New Exception("ERROR: matrix object is nothing")
Dim iNrRows As Integer = oMatrix.RowCount ' iRow
If iNrRows > 0 Then
Dim i As Integer = 1
For i = 1 To iNrRows
Dim sCode As String = ""
Dim sName As String = ""
Try
' Matrix column PrjCode
oColumn = oMatrix.Columns.Item("ePrjCode")
oCell = oColumn.Cells.Item(i)
oEdit = oCell.Specific
sCode = oEdit.Value
sName = GetNameByCode(sCode)
If Not sName.Equals("") Then
' Matrix column PrjName
oColumn = oMatrix.Columns.Item("ePrjName")
oCell = oColumn.Cells.Item(i)
oEdit = oCell.Specific
oEdit.Value = sName
End If
If iRow = i Then Exit Sub
Catch ex As Exception
Finally
End Try
Next
oForm.Refresh()
End If
End If
Catch ex As Exception
' log exception
Finally
oMatrix = Nothing
oColumn = Nothing
oCell = Nothing
oEdit = Nothing
System.GC.Collect() 'Release the handle to the table
End Try
End Sub
To get Name using Code...
Private Function GetNameByCode(ByVal sCode As String) As String
If sCode.Trim.Equals("") Then Return ""
Dim sName As String = ""
Dim oRS As SAPbobsCOM.Recordset
Try
oRS = SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
Dim sSql As String = "SELECT PrjName FROM OPRJ WHERE PrjCode = '" & sCode.Trim & "'"
oRS.DoQuery(sSql)
oRS.MoveFirst()
While oRS.EoF = False
sName = oRS.Fields.Item("PrjName").Value()
Exit While
End While
Catch ex As Exception
Finally
If Not oRS Is Nothing Then
System.Runtime.InteropServices.Marshal.ReleaseComObject(oRS)
oRS = Nothing
End If
End Try
Return sName
End Function
Note: Matrix_FetchDescriptions() have second argument (iRow As Integer) what may be used to indicate in what row you need to update PrjName column.
May be ItemManagment event when item pressed can be used... Try
HTH
BR
Sierdna S. -
Matrix with one column browse one photo
hai everybody
i am going to attached photos in each and every columns ...
pls....I dont know what you mean exactly? In matrix you want to show images or you want to store images through matrix (as attachments)?
If you want to show images in matrix, the matrix column must be image type as
<column uid="colPic" type="117" title="" description="" visible="1" AffectsFormMode="1" width="40" disp_desc="0" editable="0" right_just="0" val_on="Y" val_off="N" backcolor="-1" forecolor="-1" text_style="0" font_size="-1"><databind databound="0" table="" alias=""/><ExtendedObject/></column>
If you want attach image to matrix, the filed you have binded to matrix must be subtype link as
oUserFieldsMD.TableName = "ATTACH"
oUserFieldsMD.Name = "PATH"
oUserFieldsMD.Description = "path"
oUserFieldsMD.Type = SAPbobsCOM.BoFieldTypes.db_Memo
oUserFieldsMD.SubType = SAPbobsCOM.BoFldSubTypes.st_Link
oUserFieldsMD.EditSize = 250
lRetCode = oUserFieldsMD.Add
Then when you dbl click on field, the browse dialog will be shown automaticaly. -
Problem with checkbox column in matrix
Hello.
I have a little problem with checkbox column in matrix.
Column is binded to the UserData.
It has ValOn="Y", ValOff="N".
I use C++. It is wird problem. In matrix I have 10 columns - scrollbar role and if You want see checkbox column, You must role to the right. If this column is on the screen, and I use:
checkcell->PutChecked(VARIANT_TRUE);
then the checkbox is cheched, and if the checkbox isn`t on the screen and I use this comment - it nothing happening.
I tried to use ValOn="Y", PutChecked...
The problem i solved if the column is on the screen - if the column is first in matrix or second, but if it`s last I have a big problem.
My column with checkbox is not editable, but I tried to make it editable, check it, and then make it uneditable - the same efect.
How can I solve it ?
Sorry for my english.
Kamil WydraHello Kamil,
I am not sure about your problem, but here is an example of how to use checkbox in UI API.
First, create the matrix with checkbox column in Screen painter, and the output is an xml file, like this. Type as 121 indicates that it is a check box.
- <column AffectsFormMode="0" backcolor="-1" description="" disp_desc="0" editable="0" right_just="0" title="Rented" type="121" uid="Rented" val_off="N" val_on="Y" visible="1" width="41">
<databind alias="U_RENTED" databound="1" table="@VIDS" />
<ExtendedObject />
Second, bind the column to table from DB. This is a bug of 2004 Screen Painter, so if you are using 2005 Screen Painter, there is no problem.
Third, when you open the form, you can check and uncheck the cell.
BTW, please set the editable of the column to true.
Hope this helps,
Nick -
Hi All,
I need to create a 5/5 matrix in SSRS report. The data will be :
Col_Side Col_Header Col_data
1 1 1
1 1 1
1 2 1
1 5 1
1 5 1
1 5 1
2 3 1
2 5 1
3 1 2
3 1 2
3 1 2
4 2 1
4 4 1
5 1 1
5 1 1
5 5 1
So, the matrix column will be Col_Header and matrix row will be Col_Side and count(Col_data) will be on the data.
Finally, it will create a 5 by 5 matrix with Count(Col_data) as its data for each combinations. If there is no combination (for ex: in the above data we do not have no combination of (1,3) , (1,4) , (2,1) etc..) then the matrix will be filling that corresponding
cell with zero.
Here I need to fill the cells with some colors based on some criteria.
I need to fill (5,3), (5,4), (5,5) combination with "Red" color. Like this , I need to give different colors in each of the cells. Here, (5,5) combination will be having 1 in its cell. (5,4) and (5,3) will be having zero in its corresponding
cells. I 'm trying to fill all the 3 cells with "Red" color. But, I am able to fill only (5,5) with "Red" color. Since the other 2 cells (5,3) and (5,4), has zero in their cells, it will not fill the cells with "Red" color.
How can I fill those two cells (5,3) and (5,4) with red color?
I know this is very vague. I have no option to give the picture here..
Please suggestHi Julie,
According to your description, there is a 5/5 matrix with three fields: Col_Side, Col_Header, Col_data. You drag Col_Side field to Rows, Col_Header to Columns and Col_data to Data, then filling blank cells with zero using expression. Now you want to fill
(5,3), (5,4), (5,5) cells with red color using expression, but it has no effect on cells (5,3) and (5,4).
According to my test, the expression has on effect on cells (5,3) and (5,4) since there is no corresponding data and the cells are blank. As a workaround, we can insert data for cells (5,3) and (5,4) in dataset, then use expression by following steps:
In the dataset, insert two sets of data (5,3,0), (5,4,0).
Right-click the cell of data, click Text Box Properties.
Click Fill in left pane, click (fx) button, then type the expression like below, then click OK.
=iif(Fields!Col_Side.Value=5 and Fields!Col_Header.Value >=3 ,"red","white" )
The following screenshot is for your reference:
If you have any more questions, please feel free to ask.
Thanks,
Wendy Fu -
Matrix report data with summary column in excel format
Hi ,
I want to display output of matrix report with summary column in excel format.
I have tried using spreadsheet but column header and actual data is displaying in proper order.
Please tell me the way how to do this ASAP.
Thanks in advance.Hi ,
I want to display output of matrix report with summary column in excel format.
I have tried using spreadsheet but column header and actual data is displaying in proper order.
Please tell me the way how to do this ASAP.
Thanks in advance. -
ComboBox with two columns?
Do you guys know how we can have a DAC comboBox with two columns(e.g. emp_no, emp_name) to update a column(e.g. emp_no) in database?
Thanks for your response.
Ali
nullgrin You don't like my suggestion of creating a view ( or view object ) that where you concatenate 2 or more strings of interest into a separate new attribute... that is used to display?
Yeah, kinda hokey, but quick to implement. -
Combobox column in a user matrix
hi!
I've a user matrix in a user form whith 2 ComboBox columns. I've just filled these whith their values and descriptions. But, when the addon is running, if i select a value in a combo cell, it doesn't appear in the cell!
I explain myself: i load the form, i click on the combo column (1st row), i click on a value from the combo list, the list is closed but the cell is still empty! Why?
Please help me,
thanks
Giuseppethat's ok!
I have to add an UserDataSource!
Now it run well -
Binnding matrix column with dbdatasource column
Hi experts,
Iam using a matrix to list the sales employeess...(similar to that of SalesEmployee master form ), iam bindng my columns with dbdatasource columns,
so when i bind a column with dbdatasource column of type numeric(19.6), default value of 0.00000 is getting displayed in the column, so how can i prevent displaying 0.00000 .
I want to only display the value if it is >0.
Regards,
RejishRajan.T.NHI,
It is easy. if The cell type is Edit then you can control of the Supperssing Zeros.
Sample: (i know you have it already)
To do:
1. Create matrix add column type it_edit
2. load data
3. Set supresszeros to true of the cell !
oColumn = oColumns.Add("QTY", SAPbouiCOM.BoFormItemTypes.it_EDIT)
oColumn.TitleObject.Caption = "QTY"
oColumn.Width = 40
oColumn.Editable = True
oColumn.DataBind.SetBound(True, "", "QTY")
'load data
For i As Integer = 1 To oMatrix.RowCount
Dim oEditText As SAPbouiCOM.EditText = oMatrix.Columns.Item("QTY").Cells.Item(i).Specific
oEditText.SuppressZeros = True
Next
regards,
J. -
Combobox with multiple columns
Is it possible to make a combobox with two columns in the dropdown area?
Thanksmake your own componen to show 2 colums... and assig it to combo box as itemrenderer...
twoColums.mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"
horizontalScrollPolicy="off" >
<mx:Text text="{data.Column1}" width="93">
</mx:Text>
<mx:Text text="{data.Column2}">
</mx:Text>
</mx:HBox>
in your main app or another custom conponen place your combobox like thi:
<mx:ComboBox id="myCB" dataProvider="{yourdata}" labelField="Column1"
itemRenderer = "components.twoColums">
</mx:ComboBox>
mybe you need to add width and dropdowwidth properties to show the items in a good way....hope this work..
PD. this works the same for Adobe autocomplete.. as autocomplete is a component heritated from combobox..:
make shure you have included the autocomplete component in your project at its says in the readme file included by Adobe then..
<Adobe:AutoComplete id="myCB" arrowButtonWidth = "30" dataProvider="{yourdata}" labelField="Column1"
itemRenderer = "components.twoColums">
</Adobe:AutoComplete>
note the arrowButtonWidth if you dont put this property the autocomplete will just show as a common text field...
remember auto complete will have some issues with the itemrenderer stuff.. if you wirite too fast, the first character you write will be lost, so calmd down, im traing to figure out how to soleve that issue...
haaaa by the way if you already have another way to show 2 columns please telme how you solve it... -
How to fill the first column '#' of matrix with row id in user form?
Hi All,
I am having a user defined form in which, I m having a matrix and m populating the matrix with the output of an sql query.
something like this:
SQL_Str= "select col1,col2,......from.... "
OPopDBTable.ExecuteQuery(SQL_Str)
oMatrix.AddRow()
oMatrix.Columns.Item("Col3").DataBind.Bind("PopTable", "col1")
oMatrix.Columns.Item("Col2").DataBind.Bind("PopTable", "col2")
oMatrix.LoadFromDataSource()
Now, in this, how can I assign row number to first column ('#' column ) ??
regards,
BinitaAh...the ROW_NUMBER() was posted by Petr - also thank you (again)
With my example-query from the other thread:
SELECT
CAST(
ROW_NUMBER() OVER (ORDER BY T1.U_LogNo ASC) AS INT
) AS RowCnt,
T1.Code,
T1.U_ParcelNo,
T1.U_LogNo
FROM
[@XXX_EXAMPLE] T1
WHERE
T1.U_ParcelNo='132006'
ORDER BY
T1.U_LogNo ASC
...this works for me (it's quickly copied from several subs/func. - I hope it's not too much disordered):
DtLogs.ExecuteQuery(query)
oMtxLogs.Columns.Item("0").DataBind.Bind("DT_LOGS", "RowCnt")
oMtxLogs.Columns.Item("1")........
oMtxLogs.LoadFromDataSource() -
Matrix with different dimensions for each column
Hi,
I would like to have a matrix with different dimensions (rows) for each
column, for example, I want the first column has 3 rows, the second one
5 rows, the third one 10 rows, and so on.....
With a simple array it is not possible, and then I make an array (for
my columns) of clusters and each cluster has another array (rows for
that column). Is it the best way to do it? Is it correct?
Thanks,
ToNi.Yes, everything we told you in this old thread is still true!
LabVIEW Champion . Do more with less code and in less time . -
Hi all,
I am considering moving from a matrix to a grid
a. How do I assign valid values to a grid combobox column?
b. Does the grid support all matrix features (link button, etc)?
best,
AsherHi Chris,
Here is my code:
// Data table:
DataTable dataTable = testForm.DataSources.DataTables.Add("aaa");
dataTable.ExecuteQuery("SELECT * FROM [@AAA]");
// Grid:
Item gridItem = testForm.Items.Add("grd", BoFormItemTypes.it_GRID);
gridItem.Width = 450;
gridItem.Height = 300;
Grid grid = (Grid)gridItem.Specific;
grid.DataTable = dataTable;
// Columns:
GridColumn textColumn = grid.Columns.Item(2);
((EditTextColumn) textColumn).LinkedObjectType = "4";
GridColumn comboColumn = grid.Columns.Item(0);
comboColumn.Type = BoGridColumnType.gct_ComboBox;
((ComboBoxColumn) comboColumn).ValidValues.Add("3", "3");
This code fails on the last line with this exception:
Unable to cast COM object of type 'SAPbouiCOM.GridColumnClass' to interface type 'SAPbouiCOM.ComboBoxColumn'.
Any ideas?
Asher
P.S.
The link works fine. Thanks.
Maybe you are looking for
-
Can't connect to local web server
I'm not quite sure when this happened; I think it was upgrading to iPhoneOS 3.x but I can't swear to that (currently running 3.1). Anyway, the problem is that, whether from my app or even simply using Safari, I can't connect to a local webserver. If
-
How to create a hyperlink to prompt an email to a certain email address?
If I want my readers to be able to click on the text "[email protected]" I want their email to automatically pop up with [email protected] as the recipient of the email they are composing. Does anyone know how to do this manually? Thank you times in
-
What is the compatibility issues restricting use of Dreamweaver MX2004 with Windows 7
I can't launch an update my website design on Dreamweaver MX2004. Adobe technicians have informed me the application is not compatible with Windows 7. The Dreamweaver was already loaded onto this computer when I took over this assignment. I assume
-
Stacked Bar graph with multiple bars
Hi, I want to have a graph where I will have multiple stacked BARs. Having single stacked bar is OK. Is there a way to achieve this ? I am using 11.1.1.2 ADF and ADFBC For Ex: You have -TV sales per month for different regions -DVD sales per month fo
-
Hi Experts, I am getting the above error, while saving the order, and in MB1C. I am trying it in IDES, Even ,while transferring Customer and material, i am getting the same error.I checked feeder, GTS systems logical systems, both the systems are rem