<%@ page language="C#" autoeventwireup="true" inherits="ims.report, ims.web" enableviewstatemac="false" enableEventValidation="false" %>
<!DOCTYPE html>
<html id="report">
<head runat="server"><title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" /><meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="s1" runat="server" OnAsyncPostBackError="AsyncError" />
    <asp:HiddenField runat="server" ID="sorted" />
    <div runat="server" id="EmptyPrompt" visible="false" class="highlight"></div>
    <asp:UpdatePanel ID="up" runat="server" ChildrenAsTriggers="false" OnPreRender="InitTable" UpdateMode="conditional" RenderMode="Block">
    <ContentTemplate>
        <asp:HiddenField runat="server" ID="layout" /><asp:HiddenField runat="server" ID="detail_sort" />
        <div runat="server" id="reportTitle" class="pageTitle"></div>
        <asp:UpdatePanel ID="dataArea" runat="server" ChildrenAsTriggers="false" UpdateMode="conditional" RenderMode="Block">
        <ContentTemplate> </ContentTemplate></asp:UpdatePanel>
        <div runat="server" id="footer"></div>
    </ContentTemplate>
    </asp:UpdatePanel>
    <div id="loading"><img src="images/loading.gif" />正在生成报表，请稍候…</div>
    <ims:Pop runat="server" ID="p" Width="700" OnClientUpdated="InitSettingCtl();" OnOkClientClick="return PreMakeReport();" HideOnOkClientClick="false" OnOkClick="MakeReport" HelpSubject="report" OkButtonText="生成报表" CustomCss="noline notfocus" ShowProgress="false">
        <ContentTemplate>
            <div class="item" style="margin-top:-2px">● 根据什么来分组统计？</div>
                <div class="setting">
                    <table class="autoWidth"><tr><td id="tdSetting">
                        <div id="group1">选择：<asp:DropDownList runat="server" ID="ddlG1"></asp:DropDownList><span class="hide">&nbsp;<asp:DropDownList runat="server" ID="ddlP1"></asp:DropDownList><span class="hide">：<asp:TextBox runat="server" ID="tbSep1" Width="176"></asp:TextBox></span><asp:DropDownList runat="server" ID="ddlSpan1" CssClass="hide"></asp:DropDownList></span>&nbsp;&nbsp;排序：<asp:DropDownList runat="server" ID="ddlSort1"></asp:DropDownList><asp:DropDownList runat="server" ID="sort1"></asp:DropDownList></div>
                        <div runat="server" id="group2" class="hide">二级：<asp:DropDownList runat="server" ID="ddlG2"></asp:DropDownList><span class="hide">&nbsp;<asp:DropDownList runat="server" ID="ddlP2"></asp:DropDownList><span class="hide">：<asp:TextBox runat="server" ID="tbSep2" Width="176"></asp:TextBox></span><asp:DropDownList runat="server" ID="ddlSpan2" CssClass="hide"></asp:DropDownList></span>&nbsp;&nbsp;排序：<asp:DropDownList runat="server" ID="ddlSort2"></asp:DropDownList><asp:DropDownList runat="server" ID="sort2"></asp:DropDownList></div>
                        <div runat="server" id="group3" class="hide">三级：<asp:DropDownList runat="server" ID="ddlG3"></asp:DropDownList><span class="hide">&nbsp;<asp:DropDownList runat="server" ID="ddlP3"></asp:DropDownList><span class="hide">：<asp:TextBox runat="server" ID="tbSep3" Width="176"></asp:TextBox></span><asp:DropDownList runat="server" ID="ddlSpan3" CssClass="hide"></asp:DropDownList></span>&nbsp;&nbsp;排序：<asp:DropDownList runat="server" ID="ddlSort3"></asp:DropDownList><asp:DropDownList runat="server" ID="sort3"></asp:DropDownList></div>
                        <div runat="server" id="group4" class="hide">四级：<asp:DropDownList runat="server" ID="ddlG4"></asp:DropDownList><span class="hide">&nbsp;<asp:DropDownList runat="server" ID="ddlP4"></asp:DropDownList><span class="hide">：<asp:TextBox runat="server" ID="tbSep4" Width="176"></asp:TextBox></span><asp:DropDownList runat="server" ID="ddlSpan4" CssClass="hide"></asp:DropDownList></span>&nbsp;&nbsp;排序：<asp:DropDownList runat="server" ID="ddlSort4"></asp:DropDownList><asp:DropDownList runat="server" ID="sort4"></asp:DropDownList></div>
                        <div runat="server" id="group5" class="hide">五级：<asp:DropDownList runat="server" ID="ddlG5"></asp:DropDownList><span class="hide">&nbsp;<asp:DropDownList runat="server" ID="ddlP5"></asp:DropDownList><span class="hide">：<asp:TextBox runat="server" ID="tbSep5" Width="176"></asp:TextBox></span><asp:DropDownList runat="server" ID="ddlSpan5" CssClass="hide"></asp:DropDownList></span>&nbsp;&nbsp;排序：<asp:DropDownList runat="server" ID="ddlSort5"></asp:DropDownList><asp:DropDownList runat="server" ID="sort5"></asp:DropDownList></div>
                    </td><td class="vbottom">&nbsp;<a runat="server" id="aAdd" href="javascript:void(0);" onclick="return addGroup();">增加下级分组</a></td></tr></table>
                </div>
            <div class="item">● 报表要显示哪些内容？</div>
            <div class="setting"><asp:CheckBoxList runat="server" ID="cblFields" class="colorText" RepeatLayout="Flow" ToolTip="拖动调序" RepeatDirection="Horizontal"></asp:CheckBoxList>　<img src='images/selectall.gif' class='slt' title='全选/全不选' onclick="SelectAll('p_cblFields');" /><img src='images/revselect.gif' class='slt' title='反选' onclick="RevSelect('p_cblFields');" />
                <div class="sepline2"></div>
                选项：<asp:CheckBox runat="server" Checked="false" ID="cbTitle" Text="报表标题" />&nbsp;<asp:CheckBox runat="server" ID="cbDetail" Text="明细记录" />&nbsp;<asp:CheckBox runat="server" ID="cbCount" Text="计数" />&nbsp;<asp:CheckBox runat="server" ID="cbPrinter" Text="报表打印人" />&nbsp;<asp:CheckBox runat="server" ID="cbTime" Text="打印时间" />
            </div>
            <div class="item">● 统计方法：<asp:DropDownList runat="server" ID="ddlCompute"></asp:DropDownList></div>
            <div class="setting" runat="server" id="spanExclude" title="勾选不予统计的字段">排除：<asp:CheckBoxList runat="server" ID="cblExclude" CssClass="colorText" RepeatLayout="Flow" RepeatDirection="Horizontal"></asp:CheckBoxList></div>
            <div class="item" id="divTitle">● 报表标题：<asp:RadioButton runat="server" ID="rbAuto" GroupName="ReportTitle" Text="自动生成" Checked="true" /><asp:RadioButton runat="server" ID="rbCustom" GroupName="ReportTitle" CssClass="nomargin" Text="指定：" /><asp:TextBox runat="server" ID="tbTitle" Width="192" ToolTip="输入报表标题"></asp:TextBox></div>
            <div class="item" id="divDetailSort">● 明细记录排序：<asp:DropDownList runat="server" ID="ddlDetailSort"></asp:DropDownList> <asp:DropDownList runat="server" ID="sortDetail"><asp:ListItem Value="ASC" Selected="True">升序</asp:ListItem><asp:ListItem Value="DESC">降序</asp:ListItem></asp:DropDownList></div>
        </ContentTemplate>
    </ims:Pop>        
    <asp:UpdatePanel ID="upBtns" runat="server" ChildrenAsTriggers="false" UpdateMode="conditional" class="bigger">
    <ContentTemplate>
        <input type="button" class="btn" value="报表设置" runat="server" id="btnSetting" onclick="ShowPop('p_popup');" />
	    <input type="button" runat="server" class="btn" value="报表操作" id="btnManage" onclick="return showMenu();" onserverclick="ManageReports" />
        <input type="button" runat="server" id="btnExport" onclick="return toExportAs('#up');" value="导出" class="btn" />
        <input type="button" runat="server" id="btnPrint" value="打印" accesskey="P" onclick="$('#up').printIt();" class="btn" />
    </ContentTemplate>
    </asp:UpdatePanel>
    <ims:Pop runat="server" ID="m" ShowOkButton="false" CanelButtonText="关闭" Title="管理报表" HelpSubject="reportManage" CustomCss="noline">
        <ContentTemplate>
            <div runat="server" id="allReports">
                <table class="normal">
                    <tr><th>报表名称</th><th style="width:60px">设为默认</th><th style="width:32px">更名</th><th style="width:32px">删除</th></tr>
                    <asp:PlaceHolder runat="server" ID="phReports"></asp:PlaceHolder>
                </table>
            </div>
            <fieldset class="mtop_n mbottom_s"><legend>默认报表规则</legend>
                <div class="padbox">
                    <ol runat="server" id="olRules" class="olRules"></ol>
                    <div class="right"><a href="#" id="aAddRule" onclick="return toAddRule();" runat="server" onserverclick="ToAddRule" class="u">添加规则</a></div>
                </div>
            </fieldset>
            <asp:CheckBox runat="server" ID="cbDisChange" Text="禁止普通用户切换报表" onclick="switchChange();" />
        </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="rule" ShowProgress="false" CustomCss="noline" OnClientUpdated="setTimeout(initRule,0);" Width="410" OnOkClick="SaveRule" HideOnOkClientClick="false">
        <ContentTemplate>
            <table class="fixedLayout">
                <tr><td class="ruleKey">指定角色：</td><td><asp:TextBox runat="server" ID="tbRoles" TextMode="MultiLine" Rows="3" Width="99%" acfid="RoleName" chars=";；,，、" ToolTip="输入角色名。多项之间以逗号、分号或顿号分隔"></asp:TextBox></td></tr>
                <tr><td class="ruleKey">默认报表：</td><td><asp:DropDownList runat="server" ID="ddlAll"></asp:DropDownList></td></tr>
            </table>
        </ContentTemplate>
    </ims:Pop>
    <asp:UpdatePanel ID="reportList" runat="server" UpdateMode="Conditional" class="menu" />
    <script src="js/comm.js"></script><script src="js/report.js"></script>
    </form>
</body>
</html>