提示有错的就是这行:行 17: <cr:CrystalReportViewer id=CrystalReportViewer1 style="Z-INDEX: 103; LEFT: 1px; POSITION: absolute; TOP: 5px" runat="server" ReportSource="<%# C:\Inetpub\wwwroot\YKE\CrystalReport1.rpt %>" Height="1073px" Width="1030px">

解决方案 »

  1.   

    .net帮助:
       在 WebForm1.aspx 的“设计”选项卡中选择 Web 窗体查看器。在“属性”窗口中,单击与 DataBindings 属性相邻的方形按钮。在“可绑定属性”下的左窗格中选择“ReportSource”。在右下窗格中,单击“自定义绑定表达式”,输入完整路径名 "c:\\Reports\\My Report.rpt"(要带一对双引号)。 你试一下。我看了很多文章都是这么写的。我也正在研究水晶报表,问题很多。你试了之后通过与否回话!!!
      

  2.   

    要带一对双引号 <cr:CrystalReportViewer id=CrystalReportViewer1 style="Z-INDEX: 103; LEFT: 1px; POSITION: absolute; TOP: 5px" runat="server" ReportSource='<%# "C:\Inetpub\wwwroot\YKE\CrystalReport1.rpt " %>' Height="1073px" Width="1030px">
      

  3.   

    给你一段最简单的代码:protected CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1;  //报表查看器,直接放置在页面上的
    //声明一个ReportDocument对象,用于装载rpt文件的
    protected CrystalDecisions.CrystalReports.Engine.ReportDocument myReportDocument;  private void Page_Load(object sender, System.EventArgs e)
    {
    myReportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
    myReportDocument.Load(Server.MapPath("CrystalReport1.rpt"));   //装载rpt文件 //设置rpt文件中用到的表的登录信息
    CrystalDecisions.Shared.TableLogOnInfo loginfo=new CrystalDecisions.Shared.TableLogOnInfo();
    loginfo.ConnectionInfo.UserID="sa";
    loginfo.ConnectionInfo.Password="jjz699";
    myReportDocument.Database.Tables["orders"].ApplyLogOnInfo(loginfo); CrystalReportViewer1.ReportSource = myReportDocument;
    CrystalReportViewer1.DisplayGroupTree = false;
    CrystalReportViewer1.DataBind();  //绑定显示
    }
      

  4.   

    晕啊,加了双引号,调试没有报错了,可是却没有报表显示
    显示出来了这样一个东东
    |————————————————————————————|
    |CrystalReportViewer - CrystalReportViewer1              |
    |使用 ReportSource 或 DataBindings 属性指定一个报表源    |
    |————————————————————————————|就和在设计的时候,还没有给CrystalReportViewer添加报表源时,CrystalReportViewer显示的那样,晕,奇怪的问题~!
      

  5.   

    哦,搞错了,出现上面的情况是把“\”改成“\\”以后
    加双引号提示错误为:
    ===============================================================
    编译错误 
    说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。 
    编译器错误信息: CS1009: 无法识别的转义序列
    源错误:行 13:  <form id="Form1" method="post" runat="server">
    行 14:  <FONT face="宋体">
    行 15:  <CR:CrystalReportViewer id=CrystalReportViewer1 style="Z-INDEX: 101; LEFT: -10px; POSITION: absolute; TOP: 2px" runat="server" Width="1030px" Height="1073px"  DisplayGroupTree="False" ReportSource='<%# "E:\下载\软件\2003522107\CrystalReport.Net部分\\ch3\WebApplication3\Student.rpt" %>'>
    行 16:  </CR:CrystalReportViewer></FONT>
    行 17:  </form>
     源文件: http://localhost/WebApplication1/WebForm1.aspx    行: 15
      

  6.   

    ReportSource='<%# "E:\\下载\\软件\\2003522107\\CrystalReport.Net部分\\ch3\\WebApplication3\\Student.rpt" %>'>
    然后再参照 楼上的 chnking(kent)
      

  7.   

    没有安装Crystal web浏览。在默认安装里是没有的。找张盘修补一下
      

  8.   

    问题解决,原来是两个版本的冲突
    .net里面默认安装了9.0的
    我又安装8.0的
    刚刚卸载了8.0的,现在问题搞定了~!