请选择 进入手机版 | 继续访问电脑版
 找回密码
 立即注册

QQ登录

只需一步,快速开始

kinber

中级会员

33

主题

89

帖子

533

积分

中级会员

积分
533

活字格认证微信认证勋章元老葡萄

kinber
中级会员   /  发表于:2016-3-14 20:52  /   查看:3003  /  回复:2
本帖最后由 Lenka.Guo 于 2016-3-15 12:10 编辑
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReportViewHtml5.aspx.cs" Inherits="Attendance.ReportViewHtml5" %>

  2. <%@ Register assembly="GrapeCity.ActiveReports.Web.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" namespace="GrapeCity.ActiveReports.Web" tagprefix="ActiveReportsWeb" %>
  3. <%@ Register TagPrefix="ActiveReportsWeb" Namespace="GrapeCity.ActiveReports.Web" Assembly="GrapeCity.ActiveReports.Web.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" %>

  4. <!doctype html>

  5. <html xmlns="http://www.w3.org/1999/xhtml" >
  6. <head runat="server">
  7.     <title>无标题页</title>
  8.     <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
  9.     <link rel="stylesheet" href="/Plugin/AR/Html5/GrapeCity.ActiveReports.Viewer.Html.css"/>
  10.     <link rel="stylesheet" href="/Plugin/AR/Html5/theme-cosmo.css"/>
  11.     <script src="/Js/jquery.min.js" type="text/javascript"></script>
  12.     <script src="/Js/CommonFun.js" type="text/javascript"></script>
  13.     <script src="/Plugin/AR/Html5/bootstrap-3.0.0.js" type="text/javascript"></script>
  14.     <script src="/Plugin/AR/Html5/knockout-2.3.0.js" type="text/javascript"></script>
  15.     <script src="/Plugin/AR/Html5/GrapeCity.ActiveReports.Viewer.Html.js" type="text/javascript"></script>
  16.     <script type="text/javascript">
  17.         $(function () {
  18.             var viewer = GrapeCity.ActiveReports.Viewer(
  19.             {
  20.                 element: '#viewer',
  21.                 report: {
  22.                     id: "rpt/kqrb.rdlx",
  23.                     parameters: [
  24.                     {
  25.                         name: "QueryDate",
  26.                         value: getQueryStringByName("QueryDate")
  27.                     }]
  28.                 },
  29.                 selectedReportIndex: 0,
  30.                 reportService: {
  31.                     url: '/ActiveReports.ReportService.asmx'
  32.                 },
  33.                 uiType: 'desktop',
  34.                
  35.                 documentLoaded: function reportLoaded() {
  36.                     console.log(viewer.pageCount);
  37.                 },
  38.                 localeUri: '/plugin/AR/Html5/language/cn.txt',
  39.                 reportLoaded: function (reportInfo) {
  40.                     console.log(reportInfo.parameters);
  41.                 },
  42.                 error: function (error) {
  43.                     console.log("error");
  44.                 }
  45.             });

  46.             //查询
  47.             $("#QueryKey").val(getQueryStringByName("QueryDate"));
  48.             $("#QueryButton").click(function () {
  49.                 var localurl = self.location.href;
  50.                 localurl = RemoveQueryString(localurl, "QueryDate");
  51.                 localurl = AddQueryString(localurl, "QueryDate", $("#QueryKey").val());

  52.                 self.location.href = localurl;
  53.             });

  54.         });
  55.     </script>
  56.     <style type="text/css">
  57.         #ExportSelect option, #ReportSelect option
  58.         {
  59.             padding: 5px !important;
  60.         }
  61.         .QueryBar {
  62.             margin: 0 auto;
  63.             width: 970px;
  64.             height: 40px;
  65.         }
  66.     </style>
  67. </head>
  68. <body>
  69. <form id="form1" runat="server">
  70.         <div class="QueryBar">
  71.                     查询月份<input id="QueryKey" type="text" /><input id="QueryButton" type="button" value=" 查询 " />
  72.         </div>

  73. <div id="viewer" style="width:970px;height:800px; margin: 0 auto;">
  74.    
  75. </div>

  76. </form>
  77. </body>
  78. </html>
复制代码

提示ar10文件不存在,404错误。


文件结构这样的,也将链接设置为对应的路径。

这是web.config配置信息
  1. <?xml version="1.0"?>
  2. <!--
  3.   有关如何配置 ASP.NET 应用程序的详细信息,请访问
  4.   http://go.microsoft.com/fwlink/?LinkId=169433
  5.   -->
  6. <configuration>
  7.   <configSections>
  8.     <section name="ActiveReports10" type="GrapeCity.ActiveReports.Web.ActiveReportsSettingsSection" />
  9.   </configSections>
  10.   <appSettings>
  11.     <add key="DbConn1" value="Data Source=(local);Initial Catalog=zkteco;Persist Security Info=True;User ID=sa;Password=xxxx" />
  12.          
  13.     <add key="SystemEncoding" value="utf-8" />

  14.   </appSettings>
  15.     <system.web>
  16.     <compilation debug="true" targetFramework="4.0">
  17.       <assemblies>
  18.         <add assembly="GrapeCity.ActiveReports.Web.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
  19.         <add assembly="GrapeCity.ActiveReports.Export.Xaml.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=CC4967777C49A3FF" />
  20.         <add assembly="GrapeCity.ActiveReports.Export.Document.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=CC4967777C49A3FF" />
  21.         <add assembly="GrapeCity.ActiveReports.Export.Pdf.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
  22.         <add assembly="GrapeCity.ActiveReports.Export.Html.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
  23.         <add assembly="GrapeCity.ActiveReports.Export.Image.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
  24.         <add assembly="GrapeCity.ActiveReports.Export.Rdf.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=CC4967777C49A3FF" />
  25.         <add assembly="GrapeCity.ActiveReports.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
  26.         <add assembly="GrapeCity.ActiveReports.Document.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
  27.         <add assembly="GrapeCity.ActiveReports.Diagnostics.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
  28.         <add assembly="GrapeCity.ActiveReports.Extensibility.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
  29.         <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
  30.         <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
  31.         <add assembly="GrapeCity.ActiveReports.Chart.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
  32.         <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  33.       </assemblies>
  34.     </compilation>
  35.     <httpModules>
  36.       <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
  37.       <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  38.     </httpModules>
  39.     <httpHandlers>
  40.       <remove verb="*" path="*.asmx" />
  41.       <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  42.       <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  43.       <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
  44.       <add verb="*" path="*.ar10" type="GrapeCity.ActiveReports.Web.Handlers.ReportBinariesStreamer, GrapeCity.ActiveReports.Web.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
  45.       <add verb="*" path="*.ActiveReport" type="GrapeCity.ActiveReports.Web.Handlers.CompiledReportHandler, GrapeCity.ActiveReports.Web.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
  46.       <add verb="*" path="*.rpx" type="GrapeCity.ActiveReports.Web.Handlers.RpxHandler, GrapeCity.ActiveReports.Web.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
  47.       <add verb="*" path="*.rdl,*.rdlx" type="GrapeCity.ActiveReports.Web.Handlers.RdlxHandler, GrapeCity.ActiveReports.Web.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
  48.       <add verb="*" path="*.ar10Web" type="GrapeCity.ActiveReports.Web.Handlers.WebCacheAccessHandler, GrapeCity.ActiveReports.Web.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
  49.     </httpHandlers>
  50.   </system.web>
  51.   <system.webServer>
  52.     <validation validateIntegratedModeConfiguration="false"/>
  53.     <defaultDocument enabled="true">
  54.       <!-- this line enables default documents for a directory -->
  55.       <files>
  56.         <clear/>
  57.         <!-- removes the existing default document list -->
  58.         <add value="index.html"/>        
  59.       </files>
  60.     </defaultDocument>
  61.     <modules runAllManagedModulesForAllRequests="true">
  62.       <remove name="ScriptModule"/>
  63.       <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  64.     </modules>
  65.     <handlers>
  66.       <remove name="WebServiceHandlerFactory-Integrated"/>
  67.       <remove name="ScriptHandlerFactory"/>
  68.       <remove name="ScriptHandlerFactoryAppServices"/>
  69.       <remove name="ScriptResource"/>
  70.       <add name="AsmxHandler" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" resourceType="Unspecified"/>
  71.       <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  72.       <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  73.       <add verb="*" path="*.ar10" type="GrapeCity.ActiveReports.Web.Handlers.ReportBinariesStreamer, GrapeCity.ActiveReports.Web.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" name="AR9_ReportBinariesStreamer" resourceType="Unspecified" preCondition="integratedMode"/>
  74.       <add verb="*" path="*.ActiveReport" type="GrapeCity.ActiveReports.Web.Handlers.CompiledReportHandler, GrapeCity.ActiveReports.Web.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" name="AR9_CompiledReportHandler" resourceType="Unspecified" preCondition="integratedMode"/>
  75.       <add verb="*" path="*.rpx" type="GrapeCity.ActiveReports.Web.Handlers.RpxHandler, GrapeCity.ActiveReports.Web.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" name="AR9_RpxHandler" resourceType="Unspecified" preCondition="integratedMode"/>
  76.       <add verb="*" path="*.rdl,*.rdlx" type="GrapeCity.ActiveReports.Web.Handlers.RdlxHandler, GrapeCity.ActiveReports.Web.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" name="AR9_RdlxHandler" resourceType="Unspecified" preCondition="integratedMode"/>
  77.       <add verb="*" path="*.ar10Web" type="GrapeCity.ActiveReports.Web.Handlers.WebCacheAccessHandler, GrapeCity.ActiveReports.Web.v10, Version=10.0.6191.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" name="AR9_WebCacheAccessHandler" resourceType="Unspecified" preCondition="integratedMode"/>
  78.     </handlers>
  79.   </system.webServer>
  80.   <runtime>
  81.     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  82.       <dependentAssembly>
  83.         <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
  84.         <bindingRedirect oldVersion="0.0.0.0-2.6.8.0" newVersion="2.6.8.0" />
  85.       </dependentAssembly>
  86.       <dependentAssembly>
  87.         <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
  88.         <bindingRedirect oldVersion="0.0.0.0-2.6.8.0" newVersion="2.6.8.0" />
  89.       </dependentAssembly>
  90.     </assemblyBinding>
  91.   </runtime>
  92.   <ActiveReports10>
  93.     <WebService reportsFolder="~/" assemblyFolder="~/" />
  94.   </ActiveReports10>
  95. </configuration>
复制代码


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

2 个回复

倒序浏览
kinber
中级会员   /  发表于:2016-3-14 21:17:09
沙发
做了一个最简单的也是报错,iis express正常,iis就不正常。 系统为win7 .net 4.0
回复 使用道具 举报
Lenka.Guo讲师达人认证 悬赏达人认证
超级版主   /  发表于:2016-3-15 11:48:04
板凳
本帖最后由 Lenka.Guo 于 2016-3-15 11:49 编辑

抱歉回复晚了,一直在重现您的问题:

首先,您所有的引用文件都添加,WebConifig文件也是完整的。所以可以排除是缺少文件导致和WebConfig文件缺项导致的错误。而且根据您的错误提示, 一直在报404错误,因为您使用的是远程站点,怀疑您的ReportService 服务文件URL 是否正确:

  •   var viewer = GrapeCity.ActiveReports.Viewer(
  •             {
  •                 element: '#viewer',
  •                 report: {
  •                     id: "rpt/kqrb.rdlx",
  •                     parameters: [
  •                     {
  •                         name: "QueryDate",
  •                         value: getQueryStringByName("QueryDate")
  •                     }]
  •                 },
  •                 selectedReportIndex: 0,
  •                 reportService: {
  •                     url: '/ActiveReports.ReportService.asmx'
  •                 },


3. 我在这边重建了工程,使用ActiveReports 10.0.6191 ,.Net4.0 ,直接将报表参数值通过HTML5Viewer传递,运行正常,您可以对照下,看看是哪里出了问题

4. 您可以把创建的简单的报错工程上传,我在这边验证是哪里出了问题。



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部