cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding Column in a Matrix

Former Member
0 Kudos

How can we hide a column in matrix permanently ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,


'Hide in runtime
oMatrix.Columns("COLID").visible = false


'Hide by column preferences for specific users
Dim oCmpSrv As SAPbobsCOM.CompanyService
Dim oFormPreferencesService As FormPreferencesService
Dim oColsPreferences As ColumnsPreferences
Dim oColPreferencesParams As ColumnsPreferencesParams
Dim i As Integer

'get company service
oCmpSrv = oCompany.GetCompanyService

'get Form Preferences Service
oFormPreferencesService = oCmpSrv.GetBusinessService(ServiceTypes.FormPreferencesService)

'get Columns Preferences Params
oColPreferencesParams = oFormPreferencesService.GetDataInterface(FormPreferencesServiceDataInterfaces.fpsdiColumnsPreferencesParams)

'set the form id (e.g. A/R invoice=133)
oColPreferencesParams.FormID = "133"

'set the user id (e.g manager= 1)
oColPreferencesParams.User = 1

'get the Columns Preferences according to the formId & user id
oColsPreferences = oFormPreferencesService.GetColumnsPreferences(oColPreferencesParams)

oColsPreferences.Item("COLUID").VisibleInForm = BoYesNoEnum.tYES 

'update  changes
oFormPreferencesService.UpdateColumnsPreferences(oColPreferencesParams, oColsPreferences)

regards

János

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks Mahesh and János.

Former Member
0 Kudos

Hi raveendra,

oColumn = oMatrix.Columns.Item("V_0")
 oColumn.Visible = False

Thanks,

Mahesh