cancel
Showing results for 
Search instead for 
Did you mean: 

How to add column totals in a matrix in SAP B1

kinyanjuikamau
Explorer
0 Kudos

I am building a SAP Business One addon and needed to know how to add column totals at the bottom. I do not see any example in the SAP SDK code examples.

And idea how it is done in the UIAPI? Or does one have to build a textbox below a column for the totals?

I need it like below:

Accepted Solutions (1)

Accepted Solutions (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert

Hi kinyanjuikamau,

Refer to the SumType Property for ColumnSetting Object in SDK Help file.

Also, check BoColumnSumType Enumeration which should help you.

Sample code from SDK Help file:

oGC = oGrid.Columns.Item(2); 
oGC.Type = SAPbouiCOM.BoGridColumnType.gct_EditText;             
oEditGC = (SAPbouiCOM.EditTextColumn)oGC; 
SAPbouiCOM.BoColumnSumType oST = oEditGC.ColumnSetting.SumType; 
oEditGC.ColumnSetting.SumType = SAPbouiCOM.BoColumnSumType.bst_Auto;

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

kinyanjuikamau
Explorer
0 Kudos

Thanks, but I don't see this under C:\Program Files (x86)\SAP\SAP Business One SDK\Samples\COM UI\CSharp\26. MatrixAndGridFeatures

Which sample does it fall in under?

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi kinyanjuikamau,

It is not provided under SDK Samples.

I want you to refer to SDK Help file which gets installed when you install SAP Business One SDK setup.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

kinyanjuikamau
Explorer
0 Kudos

This helped but I am using a matrix instead. I did the following for it to work:

SAPbouiCOM.Column oWeight;
oWeight = (SAPbouiCOM.Column)Matrix0.Columns.Item("Col_4");
oWeight.ColumnSetting.SumType = SAPbouiCOM.BoColumnSumType.bst_Auto;

Answers (1)

Answers (1)

yogananda
Product and Topic Expert
Product and Topic Expert
0 Kudos

kinyanjuikamau

I found a post on SAP Community that might help you. According to the post, you can add column totals in a matrix in SAP B1 by using the Matrix.LoadFromDataSource() method. You can find more information about this method in the SAP Business One SDK Help Center.

I hope this helps! Let me know if you have any other questions.

kinyanjuikamau
Explorer
0 Kudos

Hi, that link links back to my post.