Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
Here are my repeater It has 8 column .. I want to calculate sum of column and put that value in footer template label.. Even i m abel to calculate sum but how to put this calculated value in to the footer label
<asp:Panel ID="pnlData" runat="server" CssClass="overHidden">
                <table class="table table100">
                    <asp:Repeater ID="rptTotalSell" runat="server">
                        <HeaderTemplate>
                            <table id="tblDataTables" class="table table100">
                                <thead>
                                    <tr class="right">
                                        <th>
                                            Sr. No.
                                        </th>
                                        <th>
                                            Bill No.
                                        </th>
                                        <th>
                                            Gross Bill
                                        </th>
                                        <th>
                                            Discount
                                        </th>
                                        <th>
                                           Bill Total
                                        </th>
                                        <th>
                                            VAT Exempted
                                        </th>
                                        <th>
                                            Taxable 13.5%
                                        </th>
                                        <th>
                                            Taxable 5%
                                        </th>
                                        <th>
                                            VAT
                                        </th>
                                    </tr>
                                </thead>
                                <tbody>
                        </HeaderTemplate>
                        <itemtemplate>
                            <tr>
                                <td>
                                    <%# Container.ItemIndex + 1 %>.
                                </td>
                                <td>
                                    <asp:Label ID="lblSellId" runat="server" Text='<%# Eval("SellId") %>'>
                                </td>
                                <td>
                                    <asp:Label ID="lblBillAmt" runat="server" Text='<%# Eval("BillAmt") %>'>
                                </td>
                                <td>
                                    <asp:Label ID="lblDiscountAmt" runat="server" Text='<%# Eval("DiscountAmt") %>'>
                                </td>
                                <td>
                                    <asp:Label ID="lblBillTotal" runat="server" Text='<%# Eval("BillTotal") %>'>
                                </td>
                                <td>
                                    <asp:Label ID="lblVATExempted" runat="server" Text='<%# Eval("VATExempted") %>'>
                                </td>
                                <td>
                                    <asp:Label ID="lblSellDate" runat="server" Text='<%# Eval("VATAmt1") %>'>
                                </td>
                                <td>
                                    <asp:Label ID="lblSoldBy" runat="server" Text='<%# Eval("VATAmt2") %>'>
                                </td>
                                <td>
                                    <asp:Label ID="lblVatAmt" runat="server" Text='<%# Eval("VATAmt") %>'>
                                </td>
                            </tr>
                        </itemtemplate>
                        <footertemplate>
                            </footertemplate></tbody> </table>
 
<br /><hr />
                
                  
                  <asp:Label ID="lblSumSrNo" runat="server" Text="" style="margin-left:3px;">
                  <asp:Label ID="lblSumBillNo" runat="server" Text="" style="margin-left:15px;">
                  <asp:Label ID="lblSumGrossBill" runat="server" Text="" style="margin-left:25px;">
                  <asp:Label ID="lblSumDiscount" runat="server" Text="" style="margin-left:45px;">
                  <asp:Label ID="lblSumBillTotal" runat="server" Text="" style="margin-left:45px;">
                  <asp:Label ID="lblSumVatExempted" runat="server" Text="" style="margin-left:45px;">
                  <asp:Label ID="lblSumTaxable13" runat="server" Text="" style="margin-left:70px;">
                  <asp:Label ID="lblSumTaxable5" runat="server" Text="" style="margin-left:90px;">
                  <asp:Label ID="lblSumVat" runat="server" Text="" style="margin-left:60px;">
                  
                  <br /><hr />
 
                        
                    
            </table>
Posted 27-Nov-12 18:21pm
Edited 27-Nov-12 18:34pm
v2
Comments
biswarup88 at 28-Nov-12 0:46am
   
This BillAmt value is available in server side; you can easily calculate that and display that as Total amount.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

((Label)(rptTotalSell.Controls[
rptTotalSell
.Controls.Count - 1].Controls[0].FindControl("lblTotal"))).Text = Total.ToString();
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 CPallini 385
1 BillWoodruff 334
2 Sergey Alexandrovich Kryukov 333
3 George Jonsson 285
4 OriginalGriff 267
0 OriginalGriff 5,095
1 CPallini 4,285
2 Sergey Alexandrovich Kryukov 3,767
3 George Jonsson 2,941
4 Gihan Liyanage 2,386


Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 28 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100