on 11-24-2009 4:00 PM
Hi experts,
i need to format date in dd-mm-yyyy format on matrix column.
i'm using LoadFromDataSource() to save the data into matrix but i get the string 20091220 in matrix column data rather then 20-12-2009.
can anyone help me to achieve it?
thanks in advance.
Best regards
Andrea
Hi Andrea,
please set the SAP Business One Application the Date Format.
Path is : Goto Administration > System Initialization>General Settings> Under the Display TAB> Date Format.
Please let me know, it is working or not?
Regards
shiva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i solved the issue setting DisplayDesc attribute to false
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Andrea,
You can format the date by SQL if you are loading the matrix from a custom Query.
Use Convert SQL function to set up the required format.
Regards,
János
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
János,
i don't use a custom query to load tha matrix.
here is my code:
Dim stoMt As Matrix = stoForm.Items.Item("Matrix_0").Specific
oDBDataSource = stoForm.DataSources.DBDataSources.Item("@TC_STO")
oCon.BracketOpenNum = 1
oCon.Alias = "U_CardCode"
oCon.Operation = BoConditionOperation.co_EQUAL
oCon.CondVal = cardCode.Value
oCon.BracketCloseNum = 1
oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND
oCon = oCons.Add
oCon.BracketOpenNum = 1
oCon.Alias = "U_LineId"
oCon.Operation = BoConditionOperation.co_EQUAL
oCon.CondVal = oLineId.Value
oCon.BracketCloseNum = 1
stoMt.Clear()
stoMt.AutoResizeColumns()
oDBDataSource.Query(oCons)
stoMt.LoadFromDataSource()
how can i do to apply the required format to matrix column data?
Hello Andrea,
I have tested, and if i define a Date type User Defined Field in a User Defined Table, and bindind it into an EditText Column of the Matrix the Date is displayed in correctly.
Your UDF is Date format or just Text Format?
This is a sample for OCRD (Non UDT)
Dim oDBS As SAPbouiCOM.DBDataSource = oForm.DataSources.DBDataSources.Add("OCRD")
oItem = oForm.Items.Add("80", SAPbouiCOM.BoFormItemTypes.it_MATRIX)
oItem.Top = 100
oItem.Left = 5
oItem.Width = 90
oItem.Height = 90
Dim oCons As New SAPbouiCOM.Conditions
Dim oCon As SAPbouiCOM.Condition = oCons.Add()
oCon.BracketOpenNum = 1
oCon.Alias = "CardType"
oCon.Operation = BoConditionOperation.co_EQUAL
oCon.CondVal = "C"
oCon.BracketCloseNum = 1
oDBS.Query(oCons)
Dim oMatrix As SAPbouiCOM.Matrix = oItem.Specific
Dim oColumn As SAPbouiCOM.Column = oMatrix.Columns.Add("COL1", BoFormItemTypes.it_EDIT)
oColumn.DataBind.SetBound(True, "OCRD", "CardCode")
oColumn = oMatrix.Columns.Add("COL2", BoFormItemTypes.it_EDIT)
oColumn.DataBind.SetBound(True, "OCRD", "CreateDate")
oMatrix.LoadFromDataSource()
Regards,
János
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
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.