cancel
Showing results for 
Search instead for 
Did you mean: 

Row Index

Former Member
0 Kudos

Hi m getting an error : row index

can anybody help...

Thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi,

use this code

for j As Integer = 1 to RecSet.Recordcount

If RecSet.EoF = False Then

oMatrix.AddRow()

oEdit = oMatrix.Columns.Item("LCode").Cells.Item(j).Specific

oEdit.String = RecSet.Fields.Item(2).Value

oEdit = oMatrix.Columns.Item("LName").Cells.Item(j).Specific

oEdit.String = RecSet.Fields.Item(3).Value

End If

RecSet.MoveNext()

next

regards,

varma

Nussi
Active Contributor
0 Kudos

Hi,

not much information

maybe you access a wrong row - in a matrix the firstrow-index is 1

be sure that when you use a variable that it has the correct type - in c# int32

if you mean something else post more details.

lg David

Former Member
0 Kudos

Hi Pari,

Can you give more details for your error if you want some quickly response ?

Post your code and explain where the error appears in witch event.

Thanks

Michael

Former Member
0 Kudos

I'm using this function with formatted search...when if recordsetset.eof=false...on very next line it gives row index error........

Private Sub DoGetData(ByVal Code As String, ByVal iRow As Integer, ByRef oForm As SAPbouiCOM.Form)

Dim RecSet As SAPbobsCOM.Recordset

Dim QryStr As String

Dim oEdit As SAPbouiCOM.EditText

Dim oMatrix As SAPbouiCOM.Matrix

Try

RecSet = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

QryStr = "SELECT [@ENTITLEMENTHEAD].Code, [@ENTITLEMENTHEAD].Name, [@ELHEADDETAILS].U_LCode, [@ELHEADDETAILS].U_LDesc, [@ENTITLEMENTHEAD].U_Earning FROM [@ELHEADDETAILS] INNER JOIN [@ENTITLEMENTHEAD] ON [@ELHEADDETAILS].U_HeadCode = [@ENTITLEMENTHEAD].Code where [@ENTITLEMENTHEAD].Code='" & Code & "'"

RecSet.DoQuery(QryStr)

oMatrix = oForm.Items.Item("Detail").Specific

' oMatrix.Clear()

oMatrix.LoadFromDataSource()

Dim j As Integer = iRow

If RecSet.EoF = False Then

oEdit = oMatrix.Columns.Item("LCode").Cells.Item(j).Specific

oEdit.String = RecSet.Fields.Item(2).Value

oEdit = oMatrix.Columns.Item("LName").Cells.Item(j).Specific

oEdit.String = RecSet.Fields.Item(3).Value

oMatrix.AddRow(1, -1)

j = j + 1

RecSet.MoveNext()

End If

Catch ex As Exception

SBO_Application.MessageBox(ex.Message)

End Try

End Sub

Nussi
Active Contributor
0 Kudos

Hi,

i guess that the mistake is here

Dim j As Integer = iRow

when iRow is higher than the oMatrix.LoadFromDataSource() created lines you get an error.

lg David

Former Member
0 Kudos

thanx....problem is solved.....