473,320 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

footer totals

im keeping running totals of certain columns in a datagrid, id like to put
these totals in the footer - how do i do this ? or how can i put a label
into the footer ? (im displaying results using labels instead at the moment)
eg

Label5.Text = "Column 1 Total:- " & mordraw & " (Ratio " &
FormatNumber(ddpercent, 2) "%)"

id like that putting in the column1 footer if possible
thanks
mark
Nov 18 '05 #1
3 1382
http://www.dotnetjunkies.com/Tutoria...0BDAF711D.dcik

Greg

"mark" <ma**@remove.com> wrote in message
news:yD*************@newsfe2-gui.ntli.net...
im keeping running totals of certain columns in a datagrid, id like to put
these totals in the footer - how do i do this ? or how can i put a label
into the footer ? (im displaying results using labels instead at the
moment)
eg

Label5.Text = "Column 1 Total:- " & mordraw & " (Ratio " &
FormatNumber(ddpercent, 2) "%)"

id like that putting in the column1 footer if possible
thanks
mark

Nov 18 '05 #2

"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message
news:Oc**************@TK2MSFTNGP12.phx.gbl...
http://www.dotnetjunkies.com/Tutoria...0BDAF711D.dcik
Greg

thanks for the link but ive looked there before - it doesnt appear relevant,
im totalling on runtime using code behind like this :-

If Me.Datagrid1.Items(counter).Cells(8).Text.ToString = "" Or
Me.Datagrid1.Items(counter).Cells(8).Text.ToString = "&nbsp;" Then
Me.Datagrid1.Items(counter).Cells(8).Text = ""
Else : dsoi = dsoi + 1
dsoiavg = dsoiavg + Me.Datagrid1.Items(counter).Cells(8).Text.ToString
End If

be nice if i could put these totals into the footer - atm im using labels
outside the datagrid

Nov 18 '05 #3
I didn't look to had a the link, it is a good starting place.

I do my totaling in ItemDataBound event of datagrid:

Private Sub grid_ItemDataBound(ByVal sender As System.Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles grid.ItemDataBound

If e.Item.ItemType = ListItemType.Footer Then
Dim dt As DataTable = CType(ViewState("MyData"), DataTable)
Dim dv As New DataView(dt)
dv.RowFilter = "Type <> 5" ' don't include LOW entries!!!
Dim ColTotal(7) As HourX10

Dim drv As DataRowView

For Each drv In dv

For j As Integer = 0 To 7
ColTotal(j) += CType(drv("Day" & (j + 1).ToString),
HourX10)
Next
Next

For j As Integer = 0 To MyTSDetails.WorkDays - 1
With CType(e.Item.Cells(Columns.Day1 + j).FindControl("Day"
& j + 1 & "Total"), Label)
.Text = FooterDate(MyTSDetails.WorkDays - j - 1,
ColTotal(j))
End With
Next

Dim GrandTotal As HourX10
For j As Integer = 0 To 7
GrandTotal += ColTotal(j)
Next

Dim c As TableCell = e.Item.Cells(Columns.Total)
CType(c.FindControl("lblGrandTotal"), Label).Text =
FooterGrandTotal(GrandTotal)
End If
End Sub

(Sorry I didn't generalize it more before posting)

Greg

"mark" <ma**@remove.com> wrote in message
news:4K***************@newsfe4-gui.ntli.net...

"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message
news:Oc**************@TK2MSFTNGP12.phx.gbl...

http://www.dotnetjunkies.com/Tutoria...0BDAF711D.dcik

Greg

thanks for the link but ive looked there before - it doesnt appear
relevant,
im totalling on runtime using code behind like this :-

If Me.Datagrid1.Items(counter).Cells(8).Text.ToString = "" Or
Me.Datagrid1.Items(counter).Cells(8).Text.ToString = "&nbsp;" Then
Me.Datagrid1.Items(counter).Cells(8).Text = ""
Else : dsoi = dsoi + 1
dsoiavg = dsoiavg + Me.Datagrid1.Items(counter).Cells(8).Text.ToString
End If

be nice if i could put these totals into the footer - atm im using labels
outside the datagrid

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Galina | last post by:
Hello I have a report, which lists records. Each record has money paid field. Money paid can be 0 or not 0. I calculate and print summary of money for a group in the group footer, as well as...
7
by: Darin | last post by:
I have a report that sub-totals on a group, then grand-totals at the report footer. If there's only one group, the sub-total and grand total are redundant, so I only want to show one of them. I...
2
by: | last post by:
I have gotten the following error in trying to get totals to come out on a footer. Server Error in '/test' Application....
0
by: tfsmag | last post by:
I know how to do summary footers in a gridview... but when i try it in a paged gridview it puts a footer on every page of just the items on that page. Any suggestions on how to get it to work so...
1
by: CaptainDahlin | last post by:
I know the basics about access reports and putting page totals in the page footers. What I can't figure out is along with the current page total to display the previous page total: At the bottom...
2
by: CaptainDahlin | last post by:
I know the basics about access reports and putting page totals in the page footers. What I can't figure out is along with the current page total to display the previous page total: At the bottom...
12
D Giles
by: D Giles | last post by:
Access 2003: A subreport control (sum total calculated textbox located in the subreport report footer) does not show total of all records when referenced as a total in the main report footer - only...
1
by: Michael | last post by:
I reviewed a couple of tutorials that show how to display totals in the footer of a gridview. My footer shows up blank. Can someone help me. The code is as follows: <%@ Page Language="VB" %>...
1
by: csolomon | last post by:
Happy Friday! I was wondering if you can have more than one total in the footer. I ask this because when I set up one of my totals in the footer (lets call it total1), it works (slowly but it...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.