<%@ page language="C#" autoeventwireup="true" inherits="SB_admin_N47_Project_N47_ProjectAmountStatistics, App_Web_gdfbc0dd" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" >
    <title>每月项目金额统计表</title>
    <script language="javascript" src="<%=ResolveUrl("~/SB/control/print/LodopFuncs.js?v=1.1")%>"></script>
    <script type="text/javascript" language="javascript" src="<%=ResolveUrl("~/SB/control/easy_ui/jquery.min.js?v=1")%>"></script>
    <script type="text/javascript" language="javascript" src="<%=ResolveUrl("~/SB/control/easy_ui/jquery.easyui.min.js?v=1")%>"></script>
    <script type="text/javascript" language="javascript" src="<%=ResolveUrl("~/SB/control/easy_ui/locale/easyui-lang-zh_CN.js?v=1")%>"></script>
    <link rel="stylesheet" type="text/css" href="<%=ResolveUrl("~/SB/control/easy_ui/themes/bootstrap/easyui.css?v=1")%>" />
    <script type="text/javascript" language="javascript" src="<%=ResolveUrl("~/SB/control/js/My97DatePicker/WdatePicker.js")%>"></script>

    <object id="LODOP" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width="0"
        height="0">
        <embed id="LODOP_EM" type="application/x-print-lodop" width="0" height="0" pluginspage="<%=ResolveUrl("~/SB/control/print/install_lodop.exe")%>"></embed>
    </object>
    <style>
        
    a {
    color: #015BA7;
    }
    a:hover {
	    color: red;
    }

    </style>
</head>
<body>
    <form runat="server" id="form1">
        <div style="border-bottom: solid 1px #c3c3c3; font-size: 14px; margin-bottom: 5px">
            <span style="font-size: 14px">选择业务金额统计的月份</span>
            <span style="font-size:14px; color:Red">注：只统计完成的项目</span>
            <br />
            月份：<asp:TextBox ID="txtDate" runat="server" onfocus="WdatePicker({dateFmt:'yyyy-MM'})"
                Width="150px"></asp:TextBox>
            &nbsp;
            <asp:Button ID="btnSumbit" runat="server" Text="重新生成" OnClick="btnSumbit_Click" />
            <input id="printBtn" type="button" value="打印" onclick="printTest1()" style="width: 119px" />
            <input id="printPrint" type="button" value="导出EXCEL" onclick="OutToFileOneSheet()" style="width: 119px" />
            
        </div>
        <div id="print" style="width: 1200px;">
            <asp:Repeater ID="rptProject" runat="server" >
                <HeaderTemplate>
                    <table width="100%" border="1" cellpadding="2" bordercolor="#00000" style="border: none; font-size:13px;  border-collapse: collapse;">
                        <thead id="head">
                            <tr>
                                <td  colspan="6" style="border-right: none;" align="left">
                                    AAA———每月业务金额统计报表</td>
                                <td colspan="1" style="border-left: none;" align="left">
                                    <asp:Literal ID="litDate" runat="server"></asp:Literal>
                                    </td>
                            </tr>
                        </thead>
                        <tbody id="body">
                            <tr align="center">
                                <td style=" white-space: nowrap;">日期</td>
                                <td style=" white-space: nowrap;">单号</td>
                                <td style=" white-space: nowrap;">项目</td>
                                <td style=" white-space: nowrap;">数量</td>
                                <td style=" white-space: nowrap;">单价</td>
                                <td style=" white-space: nowrap;">金额</td>
                                <td style=" white-space: nowrap;">备注</td>
                            </tr>
                </HeaderTemplate>
                
                <ItemTemplate>
                    <tr>
                        <td> &nbsp;<%#Eval("p_cdate")%></td>
                        <td> &nbsp;<%#Eval("p_index")%></td>
                        <td> &nbsp;<%#Eval("p_name")%></td>
                        <td> &nbsp;<%#Eval("p_unitPrice")%></td>
                        <td> &nbsp;<%#Eval("p_quantity")%></td>
                        <td> &nbsp;<%#Eval("p_sumPrice")%></td>
                        <td> &nbsp;<%#Eval("p_note")%></td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    <tr style='<%=rptProject.Items.Count >0?"display:none": ""%>'>
                        <td> &nbsp;</td>
                        <td> &nbsp;</td>
                        <td> &nbsp;</td>
                        <td> &nbsp;</td>
                    </tr>
                    </tbody>
                    <tfoot id="footer">
                            <tr>
                                <th  colspan="5"  align="left">
                                打印日期：<%=DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") %>
                                </td>
                                <th  align="left" tdata="pageNO">
                                    第######页</td>
                                <th   align="left" tdata="pageCount">
                                    总共#####页</td>
                            </tr>
                    </tfoot>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
        </div>

        <script language="javascript">
     var LODOP = null;
     function printTest1()
     {	
        LODOP=getLodop(document.getElementById('LODOP'),document.getElementById('LODOP_EM'));  	
        
        LODOP.PRINT_INIT("每月业务金额统计报表");
       
        LODOP.ADD_PRINT_TABLE("5mm","5mm","200mm","287mm",$("#print").html());
        LODOP.SET_PRINT_PAGESIZE(1, "210mm","297mm","")
        
        LODOP.PREVIEW();
	 }
	 
	function OutToFileOneSheet(){

	    LODOP=getLodop(document.getElementById('LODOP'),document.getElementById('LODOP_EM'));  

		LODOP.PRINT_INIT("");
      
		LODOP.ADD_PRINT_TABLE("5mm","5mm","287mm","150mm","<table width=\"700px\" border=\"1\" cellpadding=\"2\" bordercolor=\"#00000\" style=\"border: none; font-size:13px;  border-collapse: collapse;\"><thead>"+$("#head").html()+"</thead><tbody>"+$("#body").html()+"</tbody></table>");
    
//		LODOP.SET_SAVE_MODE("QUICK_SAVE",true);//快速生成（无表格样式,数据量较大时或许用到）

		LODOP.SAVE_TO_FILE($("#txtDate").val()+"业务金额统计.xls");
		

	}

        </script>

    </form>
</body>
</html>
