以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]报表模板生成网页问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=173626) |
-- 作者:BCH -- 发布时间:2021/12/8 21:59:00 -- [求助]报表模板生成网页问题 项目发布后报表模板生成网页在云服务器运行出现错误,局域网好使,在服务器运行程序时WEUI模块好使,帮忙解决一下 “/Reports”应用程序中的服务器错误。无法找到资源。说明: HTTP 404。您正在查找的资源(或者它的一个依赖项)可能已被移除,或其名称已更改,或暂时不可用。请检查以下 URL 并确保其拼写正确。请求的 URL: /Reports/ckd.htm |
-- 作者:BCH -- 发布时间:2021/12/8 22:10:00 -- If e.Path.StartsWith("Reports\\") e.Resp Select Case e.Path Case "Reports\\ckd.htm" Dim Book As New XLS.Book(ProjectPath & "Attachments\\生产日报.xls") Dim g As New SQLGroupTableBuilder("统计表1", "泥浆接收单") g.C g.AddTable("泥浆接收单","井号","井信息录入","井号") g.Groups.AddDef("{泥浆接收单}.井号") g.Groups.AddDef("所属公司") g.Groups.AddDef("采油厂") g.Groups.AddDef("处理站") g.Groups.AddDef("{泥浆接收单}.队号") g.Groups.AddDef("日期", DateGroupEnum.None) g.Totals.AddDef("泥浆量_废弃钻井液") g.Totals.AddDef("泥浆量_岩屑") g.Filter = "[处理站] = \'" & Vars("处理站") & "\' And [日期] = \'" & Vars("日期1") & "\'" book.AddDataTable("统计表1", g.Build(True)) \'添加临时表 Book.Build() e.WriteBookAsHTML(Book) Case Else e.AsReportServer("Reports\\") End Select End If Dim wb As New weui \'身份验证 Dim Verified As Boolean \'用于标记用户是否通过了身份验证 Dim UserName As String = e.Cookies("username") \'从cookie中获取用户名 Dim Password As String = e.Cookies("password") \'从cookie中获取用户密码 If e.Path = "logon.htm" \'如果是通过登录页面访问,从PostValues即可中提取用户名和密码 If e.PostValues.ContainsKey("username") AndAlso e.PostValues.ContainsKey("password") Then UserName = e.PostValues("username") Password = e.PostValues("password") End If End If Dim ddr As DataRow= DataTables("Userr").SQLFind("Name=\'"& UserName &"\' And Password=\'"& Password &"\' ") If ddr IsNot Nothing Verified = True End If If Verified AndAlso e.Path = "logon.htm" Then wb.AppendCookie("username",UserName) wb.AppendCookie("password",Password) wb.InsertHTML("<meta http-equiv=\'Refresh\' c>") e.WriteString(wb.Build) \'生成网页 Return \'必须的 ElseIf Verified = False AndAlso e.Path <> "logon.htm" AndAlso e.Path <> "1.htm" Then \'如果用户身份验证失败,且访问的不是登录页面 wb.InsertHTML("<meta http-equiv=\'Refresh\' c>") \'那么直接跳转到登录页面 e.WriteString(wb.Build) \'生成网页 Return \'必须的 End If \'开始生成网页 |
-- 作者:BCH -- 发布时间:2021/12/8 22:10:00 -- Select Case e.path Case "logon.htm" \'登录页面 wb.AddPageTitle("","pageheader","生产管理系统","由吉林天地人生产运行部开发") If e.PostValues.ContainsKey("username") AndAlso e.PostValues.ContainsKey("password") Then \'判断是否是验证失败后的重新登录 wb.AddTopTips("","toptip1","用户名或密码错误!").msec = 2000 \'如果用户通过登录按钮访问,则给用户一个2秒的提示. End If wb.AddForm("","form1","logon.htm") With wb.AddInputGroup("form1","ipg1") .AddInput("username","户名","text") .AddInput("password","密码","password") End With With wb.AddButtonGroup("form1","btg1",True) .Add("btn1", "登录", "submit") End With Case "exit.htm" \'退出登录 wb.DeleteCookie("username") \'清除cookie中原来的用户名和密码 wb.DeleteCookie("password") wb.InsertHTML("<meta http-equiv=\'Refresh\' c>") \'那么直接跳转到登录页面 Case "", "default.htm" \'首页 wb.AddPageTitle("","pageheader","生产管理系统","由吉林天地人生产运行部开发") With wb.AddGrid("","g2") .Add("c1","泥浆接收录入", "./images/10.png", "njjslr.htm") .Add("c5","日报", "./images/下载.png", "1.htm") .Add("c12","退出", "./images/26.png", "exit.htm") \'退出登录 End With Case "1.htm" If e.PostValues.Count = 0 Then wb.AddForm("","form5","1.htm") With wb.AddInputGroup("form5","ipg5","生产日报") .AddInput("日期","日期","date") .AddSelect("处理站","处理站","五厂|七厂|八厂|随钻1部|随钻2部") End With With wb.AddButtonGroup("form5","btg1",True) .Add("btn1", "确定", "submit") End With e.WriteString(wb.Build) Else Dim dms() As String = {"日期","处理站"} \'不能为空的列名数组 For Each dm As String In dms If e.PostValues.ContainsKey(dm) = False Then \'生成错误提示页 With wb.AddMsgPage("","msgpage1","生成失败", dm & "列不能为空!") .icon = "Warn" \'改变图标 .AddButton("btn1","返回").Attribute = "" End With e.WriteString(wb.Build) Return \'必须返回 End If Next Dim dn As New String("日期") \'重新定义了日期 Dim dl As New String("处理站") \'重新定义了日期 If e.PostValues.ContainsKey(dn) AndAlso e.PostValues.ContainsKey(dl) Then Vars("日期1") = e.PostValues(dn) Vars("处理站") = e.PostValues(dl) End If With wb.AddMsgPage("","msgpage","生成日报", "努力工作,注意安全") \'生成成功提示页 .AddButton("btn1","点击查看","Reports\\ckd.htm") End With e.WriteString(wb.Build) End If End Select |
-- 作者:有点蓝 -- 发布时间:2021/12/9 8:49:00 -- 这种出错提示是IIS的,应该是访问到了IIS,把IIS里同端口的网站关闭,或者改为不同的端口 |
-- 作者:BCH -- 发布时间:2021/12/9 11:22:00 -- |
-- 作者:BCH -- 发布时间:2021/12/9 11:24:00 -- 这样还是不行啊,怎么操作请教一下 |
-- 作者:有点蓝 -- 发布时间:2021/12/9 11:48:00 -- 把default这个站点停掉 |
-- 作者:BCH -- 发布时间:2021/12/9 13:37:00 -- 状态以停止了,还是不行啊,用weui框架生成的网页都好使,只有用报表模板生成网页这个不可用 |
-- 作者:有点蓝 -- 发布时间:2021/12/9 13:40:00 -- 加个返回试试 …… Case Else e.AsReportServer("Reports\\") End Select return End If |
-- 作者:BCH -- 发布时间:2021/12/9 14:56:00 -- 试了一下还是不行啊,老师能加我QQ1400305111,我把项目传过去帮忙调试一下吗 |