显示效果:

前台代码:

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<link href="../../Css/default.css" rel="stylesheet" type="text/css" />
<script src="../../../Common/Scripts/Order/popup.js" type="text/javascript"></script>
<script src="../../../Common/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div class="default_title_all" style="width: 98%">
<ul>
<li class='hovertab '><span style="color: White">供应商综合分析</span></li>
</ul>
</div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Scripts>
</Scripts>
</asp:ScriptManager>
<uc4:SupplyAnalysis ID="SupplyAnalysis1" runat="server" />
<div class="default_title_all" style="width: 98%">
<ul>
</ul>
</div>
<table width="98%" border="" align="center" cellpadding="" cellspacing="">
<tr>
<td align="center" valign="top">
<table width="100%" border="" cellspacing="" cellpadding="">
<tr>
<td>
<table width="100%" border="" cellspacing="" cellpadding="" class="margin_center default_table_nobottom_dingdan">
<tr valign="middle">
<td align="right">
区域:
</td>
<td align="left">
<uc3:DropDownListUC ID="ddlArea" runat="server" CssClass="w120" />
</td>
<td align="right">
客户经理:
</td>
<td align="left">
<uc3:DropDownListUC ID="ddlClientManager" runat="server" CssClass="w120" />
</td>
<td align="right">
政策类型:
</td>
<td align="left">
<asp:DropDownList runat="server" ID="ddlType">
<asp:ListItem Text="全部" Value=""></asp:ListItem>
<asp:ListItem Text="普通" Value=""></asp:ListItem>
<asp:ListItem Text="特价" Value=""></asp:ListItem>
<asp:ListItem Text="直减" Value=""></asp:ListItem>
</asp:DropDownList>
</td>
<td align="right">
日期:
</td>
<td align="left">
<input type="text" id="txtBeginTime" runat="server" onfocus="WdatePicker({startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})"
readonly="readonly" />
至<input type="text" id="txtEndTime" runat="server" onfocus="WdatePicker({startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" />
</td>
<td>
</td>
</tr>
<tr valign="middle">
<td align="right">
航司:
</td>
<td align="left">
<uc3:DropDownListUC ID="ddlAirwayCompanyCode" runat="server" CssClass="w120" />
</td>
<td align="right">
出发:
</td>
<td align="left">
<uc3:TextBoxUC ID="txtDeparturePort" runat="server" CssClass="w120" />
</td>
<td align="right">
到达:
</td>
<td align="left">
<uc3:TextBoxUC ID="txtArrivePort" runat="server" CssClass="w120" />
</td>
<td>
</td>
<td align="left">
<asp:Button ID="btnSearch" runat="server" Text="查 询" CssClass="button_1" OnClick="btnSelect_Click" />&nbsp;&nbsp;
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" border="" cellspacing="" cellpadding="">
<tr>
<td rowspan="">
<asp:GridView ID="gvInterfaceUser" runat="server" Width="100%" AutoGenerateColumns="False"
GridLines="None" CellPadding="" ShowHeaderWhenEmpty="true" OnRowDataBound="gvInterfaceUser_RowDataBound"
CssClass="default_table margin_center dingdan_table margin_top_10" OnRowCommand="gvInterfaceUser_RowCommand" ShowFooter="True">
<RowStyle HorizontalAlign="Center" CssClass="MsOverBgColor"></RowStyle>
<HeaderStyle HorizontalAlign="Center" Height="28px" CssClass="background_efeff0">
</HeaderStyle>
<FooterStyle HorizontalAlign="Center" Height="28px" CssClass="background_efeff0"
ForeColor="Red" />
<Columns>
<asp:TemplateField HeaderText="序号">
<ItemTemplate>
<%#Container.DataItemIndex+ %>
</ItemTemplate>
<ItemStyle Width="4%" CssClass="default_table_zc_left default_table_zc_bottom" />
</asp:TemplateField>
<asp:BoundField DataField="suUserName" HeaderText="供应商">
<ItemStyle Width="8%" CssClass="default_table_zc_left default_table_zc_bottom" />
</asp:BoundField> <asp:BoundField DataField="sumCount" HeaderText="总票量">
<ItemStyle Width="8%" CssClass=" default_table_zc_left default_table_zc_bottom" />
</asp:BoundField>
<asp:BoundField DataField="pastePoint" HeaderText="贴点票量">
<ItemStyle Width="8%" CssClass=" default_table_zc_left default_table_zc_bottom" />
</asp:BoundField>
<asp:BoundField DataField="feesReceivable" HeaderText="手续费应收" DataFormatString="{0:0.00}">
<ItemStyle Width="8%" CssClass="default_table_zc_left default_table_zc_bottom" />
</asp:BoundField>
<asp:BoundField DataField="pasteTotalMoney" HeaderText="贴点金额" DataFormatString="{0:0.00}">
<ItemStyle Width="8%" CssClass="default_table_zc_left default_table_zc_bottom" />
</asp:BoundField>
<asp:TemplateField HeaderText="实际收入">
<ItemTemplate>
<%# (Convert.ToDecimal(Eval("feesReceivable")) - Convert.ToDecimal(Eval("pasteTotalMoney"))).ToString("0.00")%>
</ItemTemplate>
<ItemStyle Width="10%" CssClass="default_table_zc_left default_table_zc_bottom" />
</asp:TemplateField>
<asp:BoundField DataField="DepartCityCount" HeaderText="本地出发票量">
<ItemStyle Width="8%" CssClass="default_table_zc_left default_table_zc_bottom" />
</asp:BoundField>
<asp:BoundField DataField="ArriveCityCount" HeaderText="回本地票量">
<ItemStyle Width="8%" CssClass="default_table_zc_left default_table_zc_bottom" />
</asp:BoundField>
<asp:TemplateField HeaderText="异地票量">
<ItemTemplate>
<%# Convert.ToInt32(Eval("sumCount")) - Convert.ToInt32(Eval("DepartCityCount"))-Convert.ToInt32(Eval("ArriveCityCount")) %>
</ItemTemplate>
<ItemStyle Width="10%" CssClass="default_table_zc_left default_table_zc_bottom" />
</asp:TemplateField>
<asp:BoundField DataField="specailCount" HeaderText="特价票量">
<ItemStyle Width="8%" CssClass="default_table_zc_left default_table_zc_bottom" />
</asp:BoundField>
</Columns>
<AlternatingRowStyle CssClass="F0F0F0 MsOverBgColor" Height="28px" />
</asp:GridView>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<div id="sumCount" runat="server" style="padding-left: 20px; padding-top: 10px;display:none;">
<label>
合计</label>总票量:&nbsp;&nbsp;&nbsp;贴点票量:<asp:Label runat="server" ID="lblsumPasteTicketCount"></asp:Label>&nbsp;&nbsp;&nbsp;手续费应收:<asp:Label
runat="server" ID="lblRecived"></asp:Label>
&nbsp;&nbsp;&nbsp;贴点金额:<asp:Label runat="server" ID="lblPasteMoney"></asp:Label>&nbsp;&nbsp;&nbsp;实际收入:<asp:Label
runat="server" ID="lblActualIncome"></asp:Label>
</div>
</td>
</tr>
<tr>
<td align="center" colspan="">
<uc1:WUCWorkPager ID="WUCWorkPager1" runat="server" />
</td>
</tr>
</table>
</td>
</tr>
</table>
<div id="details" style="display: none;">
<table>
<tr>
<td>
请求
</td>
<td>
<div id="tdRequest" runat="server">
</div>
</td>
</tr>
<tr>
<td>
返回
</td>
<td>
<div id="tdResponse" runat="server">
</div>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>

后台代码:

 public decimal mysum3 = ;//总票量
public decimal mysum4 = ;//贴点票量
public decimal mysum5 = ;//手续费应收
public decimal mysum6 = ;//贴点金额
public decimal mysum7 = ;//本地出发票量
public decimal mysum8 = ;//回本地票量
public decimal mysum9 = ;//特价票量 protected void gvInterfaceUser_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRowView myrows = (DataRowView)e.Row.DataItem; mysum3 += Convert.ToDecimal(myrows[].ToString() == "" ? "" : myrows[].ToString());
mysum4 += Convert.ToDecimal(myrows[].ToString() == "" ? "" : myrows[].ToString());
mysum5 += Convert.ToDecimal(myrows[].ToString() == "" ? "" : myrows[].ToString());
mysum6 += Convert.ToDecimal(myrows[].ToString() == "" ? "" : myrows[].ToString());
mysum7+= Convert.ToDecimal(myrows[].ToString() == "" ? "" : myrows[].ToString());
mysum8 += Convert.ToDecimal(myrows[].ToString() == "" ? "" : myrows[].ToString());
mysum9 += Convert.ToDecimal(myrows[].ToString() == "" ? "" : myrows[].ToString()); }
// 合计
if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells[].Text = "合计";
e.Row.Cells[].Text = mysum3.ToString();
e.Row.Cells[].Text = mysum4.ToString();
e.Row.Cells[].Text = mysum5.ToString("0.00");
e.Row.Cells[].Text = mysum6.ToString("0.00");
// 实际收入
e.Row.Cells[].Text = (mysum5 - mysum6).ToString("0.00");
e.Row.Cells[].Text = mysum7.ToString();
e.Row.Cells[].Text = mysum8.ToString();
// 异地票量
e.Row.Cells[].Text = (mysum3-mysum7-mysum8).ToString();
e.Row.Cells[].Text = mysum9.ToString(); }
}

c# GridView Footor列求合计的更多相关文章

  1. android手机旋转屏幕时让GridView的列数与列宽度自适应

    无意中打开了一年前做过的一个android应用的代码,看到里面实现的一个小功能点(如题),现写篇文章做个笔记.当时面临的问题是,在旋转屏幕的时候需要让gridview的列数与宽度能自适应屏幕宽度,每个 ...

  2. Asp.net 设置GridView自适应列宽不变形

    动态绑定的GridView由于列数不固定,而列又太多,这样设置GridView固定宽度就不能满足需求了.为此整理了两种方法来达到GridView自适应列宽不变形的效果. //在GridView的行数据 ...

  3. GridView模版列中设置

    在GridView模版列中设置如下<asp:TemplateField HeaderText="删除">    <ItemTemplate>         ...

  4. 如何在asp.net中获取GridView隐藏列的值?

    在阅读本文之前,我获取gridview某行某列的值一般做法是这样的:row.Cells[3].Text.ToString().有点傻瓜呵呵 在Asp.net 2.0中增加了一个新的数据绑定控件:Gri ...

  5. 鼠标指向GridView某列显示DIV浮动列表

    需求: 当GRIDVIEW数据列过多,不方便全部显示在同一行或者一些子信息需要鼠标指向某关键列GRIDVIEW的时候显示其子信息. 设计:先把需要显示的浮动数据一次过抓取出来.而不是鼠标指向的时候才从 ...

  6. 解决无法获取 GridView 隐藏列值问题

    今天遇到了一个要获取GridView隐藏列值的问题,试了好几种方法,要么获取不到,要么获取到了类列的值也隐藏了,但在样式中这一列会多出一块,,但最后找到了一个功能实现而且实现了列完美隐藏的方法和大家分 ...

  7. Asp.net简单代码设置GridView自适应列宽不变形

    动态绑定的GridView由于列数不固定,而列又太多,是要自定设置gridView的宽度 //在GridView的行数据绑定完的事件中设置 protected void gvObjectList_Ro ...

  8. Numpy 学习 array np.where lexsort 切片 按行按列求平均mean

    array 的创建可以通过list给 array print出来像一个表格,可以按行按列来观察. 原来是一个list相当于一行 np.where用于寻找一个condition下的坐标,返回的是一个2个 ...

  9. .Net GridView 序号列

    给GridView增加一列:序号列 <asp:TemplateField HeaderText="序号"> <ItemTemplate> <%# (( ...

随机推荐

  1. iOS开发:详解Objective-C runTime

    Objective-C总Runtime的那点事儿(一)消息机制 最近在找工作,Objective-C中的Runtime是经常被问到的一个问题,几乎是面试大公司必问的一个问题.当然还有一些其他问题也几乎 ...

  2. WebApi 自定义过滤器实现支持AJAX跨域的请求

    我想关于此类话题的文章,大家一搜铺天盖地都是,我写此文的目的,只是对自己学习过程的记录,能对需要的朋友有所帮助,也百感荣幸!!!废话不多说,直接上代码! 客户端:很简单的AJAX请求 <html ...

  3. 在CentOS上安装FFMPEG和Gstream-ffmpeg

    当我们用CentOS7自带的源时,是yum search不到标题上述的两个相关的包的,而opencv需要用到FFmpeg读取视频文件.这就必须安装了. 可以参考FFMPEG官方给出的文档: http: ...

  4. Java内存回收(垃圾回收)机制总结

    一.背景: Java程序员编写程序时,对于新建的对象,当不再需要此对象时,不必去释放这个对象所占用的空间,这个工作是由Java虚拟机自己完成的 ,即内存回收或垃圾回收. 二.如何知道一个对象所占用的空 ...

  5. HashMap Java Doc

    原文 public class HashMap<K,V> extends AbstractMap<K,V> implements Map<K,V>, Cloneab ...

  6. POJ3630——简单Trie树

    这个题的意思是说,给出一些字符串,判断是否有字符串是另一个字符串的前缀,当然可以用排序水过,不过这个题拿来练习一下Trie树不错. 这个题在poj的discuss上好多人说必须要静态建树,估计都是用了 ...

  7. windows10 离线包安装net3.5

    找到离线镜像: 管理员命令行运行:dism.exe /online /enable-feature /featurename:netfx3 /Source:E:\sources\sxs 路径根据实际情 ...

  8. C#关闭显示屏,使显示屏处于待机状态

    class Program { private const uint WM_SYSCOMMAND = 0x112; //系统消息 private const int SC_MONITORPOWER = ...

  9. Scala-Partial Functions(偏函数)

    如果你想定义一个函数,而让它只接受和处理其参数定义域范围内的子集,对于这个参数范围外的参数则抛出异常,这样的函数就是偏函数(顾名思异就是这个函数只处理传入来的部分参数). 偏函数是个特质其的类型为Pa ...

  10. 常用Git命令汇总

    常用Git命令汇总 跟着R哥来到了新公司(一个从硬件向互联网转型中的公司),新公司以前的代码基本是使用SVN做版本控制,甚至有些代码没有做版本控制,所以R哥叫HG做了一次Git分享,准备把公司所有的代 ...