on 2008 Jul 16 8:18 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
104 | |
10 | |
8 | |
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.