以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  用报表生成网页失败  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=169612)

--  作者:BG小白
--  发布时间:2021/6/23 3:32:00
--  用报表生成网页失败
我用文档http://www.foxtable.com/mobilehelp/里面的示例一来操作,但是显示错误

“/Reports”应用程序中的服务器错误。

无法找到资源。

说明: HTTP 404。您正在查找的资源(或者它的一个依赖项)可能已被移除,或其名称已更改,或暂时不可用。请检查以下 URL 并确保其拼写正确。

请求的 URL: /Reports/ckd.htm


什么情况啊

--  作者:BG小白
--  发布时间:2021/6/23 3:33:00
--  
是我没有指定静态文件的储存位置吗?
--  作者:BG小白
--  发布时间:2021/6/23 3:34:00
--  
HttpServer.Prefixes.Add("http://*/")
HttpServer
.WebPath = "d:\\web"  \'指定静态文件存储位置
HttpServer
.Start()
我用它指定了,还是报错,什么情况

--  作者:有点蓝
--  发布时间:2021/6/23 8:52:00
--  
报表生成网页的代码?
--  作者:BG小白
--  发布时间:2021/6/23 8:55:00
--  
http://www.foxtable.com/mobilehelp/topics/0288.htm
--  作者:BG小白
--  发布时间:2021/6/23 8:56:00
--  
If e.Path.StartsWith("Reports\\")
    e.ResponseEncoding = "gb2312"
    Select Case e.Path
        Case  "Reports\\ckd.htm"
            Dim Book As New XLS.Book(ProjectPath & 
"Attachments\\
出库单.xls")
            e.WriteBookAsHTML(Book)
       Case  "Reports\\jianli.htm"
            Dim Book As New XLS.Book(ProjectPath & 
"Attachments\\
资料卡.xls")
            e.WriteBookAsHTML(Book)
        Case Else
            e.AsReportServer("Reports\\")
    
End Select
End
 If
--  作者:BG小白
--  发布时间:2021/6/23 8:57:00
--  

1、首先打开CaseStudy目录下的示例文件"Excel报表.foxdb"文件。

2、将HttpRequest事件代码设置为:

If e.Path.StartsWith("Reports\\")
    e.ResponseEncoding = "gb2312"
    Select Case e.Path
        Case  "Reports\\ckd.htm"
            Dim Book As New XLS.Book(ProjectPath & 
"Attachments\\
出库单.xls")
            e.WriteBookAsHTML(Book)
       Case  "Reports\\jianli.htm"
            Dim Book As New XLS.Book(ProjectPath & 
"Attachments\\
资料卡.xls")
            e.WriteBookAsHTML(Book)
        Case Else
            e.AsReportServer("Reports\\")
    
End Select
End
 If

3、在命令窗口执行:

HttpServer.Prefixes.Add("http://127.0.0.1/")
HttpServer
.Start()

现在在浏览器输入网址:

http://127.0.0.1/Reports/ckd.htm


--  作者:有点蓝
--  发布时间:2021/6/23 9:05:00
--  
我测试没有问题。电脑是不是没有安装office?