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
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 800
1 OriginalGriff 503
2 Abhinav S 253
3 thatraja 245
4 Emre Ataseven 200
0 Sergey Alexandrovich Kryukov 8,282
1 OriginalGriff 4,750
2 Peter Leow 3,784
3 Maciej Los 3,515
4 Er. Puneet Goel 3,107


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