cancel
Showing results for 
Search instead for 
Did you mean: 

SubTotal

Former Member
0 Kudos
212

Hai To All,

Iam trying to create subtotal. For example, in sales and pruchasing report ->sales analysis if we choose item or vendor if we click ok report will be displayed there at the bottom of grid subtotal will be calculated how to do tht???

Regards,

Anitha

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Dear Anitha,

By verifying the SpecialLines Object is added from B1 2007 version. So you could not use it in B1 2005 and before version.

The code is copy form SAP Business One DI API 2007.

There is also a sample code in SDK 2007 sample:

SDK\Samples\COM DI\VB.NET\19.SpecialLines

Best Regards

Jane Jing

SAP Business One Forums team

Former Member
0 Kudos

Thanks Jane,

But iam using 2005B. I want to create as same sales analysis report. Some one told tht using edit box we can do u have idea about that???

But how to place the edit box inside the matirx...

Regards,

Anitha

Former Member
0 Kudos

Dear ani nazir,

Here the sample from SDK DI help:


Adding Special Line (Visual Basic) Copy Code 
' Adding a sub total special line

    Sub AddSpecialLine()

        'Adding special line

        'Assume Qut is an existing Quotation Document Object

        'There is default one special line for document 
        'Setting the type of special line to be sub total

        Qut.SpecialLines.LineType = SAPbobsCOM.BoDocSpecialLineType.dslt_Subtotal

        'Setting the after line number

        'A number that says after which line the special line will appear

        Qut.SpecialLines.AfterLineNumber = 2

        'Check for errors

        lRetCode = Qut.Update()

        If lRetCode <> 0 Then

            oCompany.GetLastError(lErrCode, sErrMsg)

            MsgBox(lErrCode & " " & sErrMsg) ' Display error message

        Else

            MsgBox("Special Lines Added")

        End If
End Sub

Best Regards

Jane Jing

SAP Business One Forums team

Former Member
0 Kudos

Thanks Jane,

Can u explain me more......How to declare Qut ??? In SAP Samples on which this example have ???

Becoz if i declare as Dim Qut as SAPbobsCOM.BoDocSpecialLineType

there is no such collection as "BoDocSpecialLineType"

Did we have to refer an library files??

SAP\SAP SDK \ Samples \???

Regards,

Anitha

Edited by: ani nazir on Jul 17, 2008 1:41 PM

Former Member
0 Kudos

Hi

I'm afraid that cannot be done through use of the SDK, its a SAP thing. But you can always perform a loop through the records of the grid to sum and obtain the totals or subtotal desired.

Then you could add either a edit tbox or static box (label) to display the result at the bottom of the grid.

hope it helps

Former Member
0 Kudos

Dear ani nazir,

You could use Document_SpecialLines Object to handle subtotal.

Please refer to the SDK DI help for detailed information.

Best Regards

Jane Jing

SAP Business One Forums team

Former Member
0 Kudos

thanks for ur reply....can u tell on which sample????????

Regards,

Anitha