-
Oct 12th, 2017, 07:12 AM
#1
Thread Starter
New Member
Calculate and display total in report
How to display total for a field in a report?
-
Oct 12th, 2017, 12:12 PM
#2
Re: Calculate and display total in report
Hi Mani,
I see that you're new ... so ... welcome to VBForums.
However, you've got to provide more details about what you want before we're able to help you.
- Are these items to be totaled coming out of some recordset?
- If it's a recordset, what technology is being used to access it, ADO, RDO, DAO, something else?
- When you say "report", what do you mean? Crystal reports? Automation to Word or Excel? Roll-your-own with Printer object? Something else?
Also, can you show us what attempts you've made? That would go a long way toward helping us to understand some of the above questions. Also, please take some time to learn how to use these forums (such as the # button for encapsulating code you post).
Mani, it is a but frustrating for us (or, at least for me) when I see at post like this. Many of us here enjoy helping people to get their programming done, but we do need some minimum of information.
Good Luck with It,
Elroy
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
-
Oct 12th, 2017, 04:23 PM
#3
Re: Calculate and display total in report
I do not use the built in VB report tool but in the one I do use and most others there is a setting to give you a total. For example in the tool I use you would place the field on the report, map it to the data field you want the total of then set the properties to sum and running total for group or perhaps in all depending on if you need a sub total for a group or a grand total for everything.
Like I say though I do not use the built in report tool so no idea how much functionality it offers in this regard or how to set it up
-
Oct 12th, 2017, 05:18 PM
#4
Re: Calculate and display total in report
-
Oct 13th, 2017, 05:03 AM
#5
Re: Calculate and display total in report
-
Oct 13th, 2017, 07:19 AM
#6
Thread Starter
New Member
Re: Calculate and display total in report
1.I am doing a project on billing. In the bill, I need to add the records displayed in the bill. I am doing it in vb6.
Code:
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.CursorLocation = adUseClient
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\mani\stock.mdb;Persist Security Info=False"
rs.Open "select * from bill", cn, adOpenStatic, adLockBatchOptimistic
DataEnvironment1.Command2 (billnotxt.Text)
DataReport1.show
Unload bill_cur_date
Unload bill_no
Unload home_page
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
2. I am using ADO
3. This is my report's snap shot
In this report i should calculate and show the result in label 35.
I am sorry i will correct myself. Thank you for answering my post.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|