Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Matrix problem (again)

I try to fill-in a matrix using a recordset and userdatasource.

here is a part of codes:

For i As Integer = 1 To rs.RecordCount

oMatrix.AddRow(i)

oUDSCardCode.ValueEx = rs.Fields.Item("CardCode").Value

oUDSCardName.ValueEx = rs.Fields.Item("CardName").Value

oUDSItemCode.ValueEx = rs.Fields.Item("ItemCode").Value

oUDSItemName.ValueEx = rs.Fields.Item("ItemName").Value

oMatrix.SetLineData(i)

oMatrix.FlushToDataSource()

rs.MoveNext()

Next i

my problem is, there is only 3 records in the recordset:

i.e.

AAACode AAAName AAAItem AAADesc

BBBCode BBBName BBBItem BBBDesc

CCCCode CCCName CCCItem CCCDesc

but the Matrix shows:

AAACode AAAName AAAItem AAADesc

BBBCode BBBName BBBItem BBBDesc

BBBCode BBBName BBBItem BBBDesc

CCCCode CCCName CCCItem CCCDesc

CCCCode CCCName CCCItem CCCDesc

CCCCode CCCName CCCItem CCCDesc

Any ideas?

Thanks

replied

Hi,

the mistake is that you use

oMatrix.AddRow(i)

that means you add 3 lines when i = 3

better add the row with

oMatrix.AddRow(1, -1)

lg David

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question