T
tfsmag
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 that it only
posts on the last page of the gridview with the totals for the entire
dataset?
here is how i'm getting the footer summary now
Protected Sub TotIncurGrid_RowDataBound(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.GridViewRowEventArgs) Handles
TotIncurGrid.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
total_paid +=
Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "total_paid"))
outstanding_reserve +=
Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem,
"outstanding_reserve"))
total_recovered +=
Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "total_recovered"))
total_incurred +=
Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "total_incurred"))
claim_count +=
Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "claim_count"))
cost_per_claim +=
Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "cost_per_claim"))
iDivider += 1
ElseIf e.Row.RowType = DataControlRowType.Footer Then
e.Row.Cells(0).Text = "<strong>Totals:</strong>"
' for the Footer, display the running totals
e.Row.Cells(1).Text = total_paid.ToString("c")
e.Row.Cells(2).Text = outstanding_reserve.ToString("c")
e.Row.Cells(3).Text = total_recovered.ToString("c")
e.Row.Cells(4).Text = total_incurred.ToString("c")
e.Row.Cells(5).Text = claim_count.ToString()
e.Row.Cells(6).Text = Convert.ToString((cost_per_claim /
iDivider).ToString("c"))
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Right
e.Row.Font.Bold = True
End If
End Sub
any help is greatly appreciated!
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 that it only
posts on the last page of the gridview with the totals for the entire
dataset?
here is how i'm getting the footer summary now
Protected Sub TotIncurGrid_RowDataBound(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.GridViewRowEventArgs) Handles
TotIncurGrid.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
total_paid +=
Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "total_paid"))
outstanding_reserve +=
Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem,
"outstanding_reserve"))
total_recovered +=
Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "total_recovered"))
total_incurred +=
Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "total_incurred"))
claim_count +=
Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "claim_count"))
cost_per_claim +=
Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "cost_per_claim"))
iDivider += 1
ElseIf e.Row.RowType = DataControlRowType.Footer Then
e.Row.Cells(0).Text = "<strong>Totals:</strong>"
' for the Footer, display the running totals
e.Row.Cells(1).Text = total_paid.ToString("c")
e.Row.Cells(2).Text = outstanding_reserve.ToString("c")
e.Row.Cells(3).Text = total_recovered.ToString("c")
e.Row.Cells(4).Text = total_incurred.ToString("c")
e.Row.Cells(5).Text = claim_count.ToString()
e.Row.Cells(6).Text = Convert.ToString((cost_per_claim /
iDivider).ToString("c"))
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Right
e.Row.Font.Bold = True
End If
End Sub
any help is greatly appreciated!