高手给看下,水晶报表翻不了页。能加载数据但是只能加载第一页
一点翻页IE就死了,也不报错。显示的页数永远是: 1 1+
我使用直接将DataTable作为数据源的方法也不行。
在线等的。
      <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" 
          GroupTreeImagesFolderUrl="" Height="940px" 
          ReportSourceID="crs" ToolbarImagesFolderUrl="" ToolPanelWidth="200px" 
          Width="1410px" HasCrystalLogo="False" />
      <CR:CrystalReportSource ID="crs" runat="server">
          <Report FileName="Report\usp_DalayReoprt.rpt">
          </Report>
      </CR:CrystalReportSource>   SqlConnection scn = new SqlConnection();//连接设定
    Access acc = new Access();   //操作基础类
    CrystalDecisions.CrystalReports.Engine.ReportDocument cr = new ReportDocument();
    string beginDate = "";
    string enddate = "";
   private void SetDateUserid()
    {
        if (txtBeginDate.Text.Trim() == "")
        {
            beginDate = "2011-01-01";
        }
        else
        {
            beginDate = txtBeginDate.Text.Trim();
        }
        if (txtEndDate.Text.Trim() == "")
            enddate = "2049-12-31";
        else
            enddate = txtEndDate.Text.Trim();
        txtUserid = TextBox1.Text.Trim();
        if (txtUserid == "")
            txtUserid = "%";
    }
 protected void Page_Init(object sender, EventArgs e)
    {
        LoadReport();
        if (IsPostBack)
        {
            LoadReport();
        }
    }
 private void LoadReport()
    {
        try
        {
            string UserAuthority = (string)(Session["Authority"]);
            if(UserAuthority!=null)
            UserAuthority = UserAuthority.Substring(1, UserAuthority.Length - 2);            TableLogOnInfo loginfo = new TableLogOnInfo();
            loginfo.ConnectionInfo.ServerName = "192.8.1.1";
            loginfo.ConnectionInfo.UserID = "sa";
            loginfo.ConnectionInfo.Password = "222";
            DataTable repdt = new DataTable();
            SetDateUserid();
            
            crs.ReportDocument.SetParameterValue("@PositionCode", UserAuthority);
            crs.ReportDocument.SetParameterValue("@Code", txtUserid);
            crs.ReportDocument.SetParameterValue("@BeginDate", beginDate);
            crs.ReportDocument.SetParameterValue("@EndDate", enddate);
            crs.ReportDocument.Load(Server.MapPath("Report/usp_DalayReoprt.rpt"));
            crs.ReportDocument.Database.Tables[0].ApplyLogOnInfo(loginfo);
            crs.DataBind();
            CrystalReportViewer1.ReportSource = crs;
            if (crs != null)
            {
                CrystalReportViewer1.DataBind();
            }
        }
        catch (Exception ex)
        {
            MessageBoxShow(ex.ToString());
        }
    }