Click here to Skip to main content
15,885,998 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
C#
<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
Updated 27-Nov-12 18:34pm
v2
Comments
sahabiswarup 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

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

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900