在WEB窗体中显示正常,编辑状态下的.aspx能正常显示出报表,运行时却出现如下错误:编译错误 
说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。 编译器错误信息: CS1026: 应输入 )源错误: 行 24:  <BODY>
行 25:  <form id="Form1" method="post" runat="server">
行 26:  <CR:CRYSTALREPORTVIEWER id=CrystalReportViewer1 runat="server" Height="1163px" Width="1000px" ReportSource="<%# E:\CrystalReport1.rpt %>">
行 27:  </CR:CRYSTALREPORTVIEWER><INPUT onclick="ieprint();" type="button" value="Button">
行 28:  <asp:table id="Table2" runat="server">
 源文件: C:\Inetpub\wwwroot\test\WebForm2.aspx    行: 26 显示详细的编译器输出:
C:\WINNT\system32> "c:\winnt\microsoft.net\framework\v1.1.4322\csc.exe" /t:library /utf8output /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files\test\01cc68ea\7c93ce7\sfvhevu7.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\mscorlib.dll" /R:"c:\winnt\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll" /R:"c:\winnt\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll" /R:"c:\winnt\assembly\gac\crystaldecisions.web\9.1.5000.0__692fbea5521e1304\crystaldecisions.web.dll" /R:"c:\winnt\assembly\gac\crystaldecisions.crystalreports.engine\9.1.5000.0__692fbea5521e1304\crystaldecisions.crystalreports.engine.dll" /R:"c:\winnt\assembly\gac\crystaldecisions.reportsource\9.1.5000.0__692fbea5521e1304\crystaldecisions.reportsource.dll" /R:"c:\winnt\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll" /R:"c:\winnt\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files\test\01cc68ea\7c93ce7\assembly\dl2\da357c06\0041ffb1_d739be01\interop.excel.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files\test\01cc68ea\7c93ce7\assembly\dl2\2a1134c5\fe9d0e7f_4e54c401\test.dll" /R:"c:\winnt\assembly\gac\system.web.mobile\1.0.5000.0__b03f5f7f11d50a3a\system.web.mobile.dll" /R:"c:\winnt\assembly\gac\crystaldecisions.shared\9.1.5000.0__692fbea5521e1304\crystaldecisions.shared.dll" /R:"c:\winnt\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll" /R:"c:\winnt\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseservices.dll" /R:"c:\winnt\assembly\gac\system.web.services\1.0.5000.0__b03f5f7f11d50a3a\system.web.services.dll" /out:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\test\01cc68ea\7c93ce7\vlc9z3fi.dll" /D:DEBUG /debug+ /optimize- /win32res:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\test\01cc68ea\7c93ce7\vlc9z3fi.res" /warnaserror /w:1  "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\test\01cc68ea\7c93ce7\vlc9z3fi.0.cs"
Microsoft (R) Visual C# .NET 编译器版本 7.10.3052.4
用于 Microsoft (R) .NET Framework 版本 1.1.4322
版权所有 (C) Microsoft Corporation 2001-2002。保留所有权利。C:\Inetpub\wwwroot\test\WebForm2.aspx(26,46): error CS1026: 应输入 )
C:\Inetpub\wwwroot\test\WebForm2.aspx(26,46): error CS1525: 无效的表达式项“:”
C:\Inetpub\wwwroot\test\WebForm2.aspx(26,47): error CS1002: 应输入 ;
C:\Inetpub\wwwroot\test\WebForm2.aspx(26,47): error CS1525: 无效的表达式项“”
C:\Inetpub\wwwroot\test\WebForm2.aspx(26,48): error CS1002: 应输入 ;
C:\Inetpub\wwwroot\test\WebForm2.aspx(26,66): error CS1002: 应输入 ;
C:\Inetpub\wwwroot\test\WebForm2.aspx(26,66): error CS1525: 无效的表达式项“)”
C:\Inetpub\wwwroot\test\WebForm2.aspx(26,67): error CS1002: 应输入 ;
C:\Inetpub\wwwroot\test\WebForm2.aspx(26,67): error CS1525: 无效的表达式项“)” 

解决方案 »

  1.   

    怎么没人告诉我呀,第一次用这种报表,还请多多指教
    在WEB窗体中显示正常,编辑状态下的.aspx能正常显示出报表,运行时却出现如下错误:编译错误 
    说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。 编译器错误信息: CS1026: 应输入 )源错误: 行 24:  <BODY>
    行 25:  <form id="Form1" method="post" runat="server">
    行 26:  <CR:CRYSTALREPORTVIEWER id=CrystalReportViewer1 runat="server" Height="1163px" Width="1000px" ReportSource="<%# E:\CrystalReport1.rpt %>">
    行 27:  </CR:CRYSTALREPORTVIEWER><INPUT onclick="ieprint();" type="button" value="Button">
    行 28:  <asp:table id="Table2" runat="server">
     源文件: C:\Inetpub\wwwroot\test\WebForm2.aspx    行: 26 显示详细的编译器输出:
    C:\Inetpub\wwwroot\test\WebForm2.aspx(26,46): error CS1026: 应输入 )
    C:\Inetpub\wwwroot\test\WebForm2.aspx(26,46): error CS1525: 无效的表达式项“:”
    C:\Inetpub\wwwroot\test\WebForm2.aspx(26,47): error CS1002: 应输入 ;
    C:\Inetpub\wwwroot\test\WebForm2.aspx(26,47): error CS1525: 无效的表达式项“”
    C:\Inetpub\wwwroot\test\WebForm2.aspx(26,48): error CS1002: 应输入 ;
    C:\Inetpub\wwwroot\test\WebForm2.aspx(26,66): error CS1002: 应输入 ;
    C:\Inetpub\wwwroot\test\WebForm2.aspx(26,66): error CS1525: 无效的表达式项“)”
    C:\Inetpub\wwwroot\test\WebForm2.aspx(26,67): error CS1002: 应输入 ;
    C:\Inetpub\wwwroot\test\WebForm2.aspx(26,67): error CS1525: 无效的表达式项“)”
      

  2.   

    首先谢谢xueqs,总算看到有人来回了,
    我再说详细一点吧,CrystalReport1.rpt是我在项目中通过建立水晶报表建立的一个报表文件,后面连了数据库里的一个表,连接成功,
    在文件WebForm2.aspx  中插入水晶报表控件
    设置ReportSource="<%# E:\CrystalReport1.rpt %>">
    (ReportSource="<%#C:\Inetpub\wwwroot\test\CrystalReport1.rpt%>">//报表在原项目中的位置。 用这两个源都一样)
     将其引用到webform页面中显示正常,能将(报)表格的内容显示出来,
    可我运行WebForm2.aspx却出现如上的错误提示,不知为何?
      

  3.   

    ReportSource="<%# E:\CrystalReport1.rpt %>">
    应该改为 ReportSource="<%# E:\\CrystalReport1.rpt %>">
    2个\
      

  4.   

    wen98091(雪) :我试了一下,还是不行 ,出现同样的错误,谢谢你
      

  5.   

    ReportSource="<%# E:\CrystalReport1.rpt %>">
    ReportSource='<%# E:\CrystalReport1.rpt %>'>String path = Server.MapPath("****.rpt");
      

  6.   

    谢谢大家,这个问题已解决,用的是"E:\\CrystalReport1.rpt"加个双引号就可以了,可是却出现另一错误,在.aspx.cs文件中加上CrystalReportViewer1.DataBind();时出现如下错误:登录失败。 
    说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: CrystalDecisions.CrystalReports.Engine.LogOnException: 登录失败。源错误: 执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。  堆栈跟踪: 
    [LogOnException: 登录失败。] 
    不知怎么回事好象还要单独为报表配置登录,可我在.rpt文件中已连好了的,怎么还会出错?
      

  7.   

    打开iis找到默认站点,找关于水晶报表的虚拟目录,然后在你的站点也建一个相同的虚拟目录,应该就可以了前提是水晶报表正确安装