水晶报表显示在网页上时不能靠左显示,打印预览时右侧部分不能显示,怀疑打印时不能全部显示,请问各位高手如何解决?谢谢!

解决方案 »

  1.   

    protected void LoadReport()
    {
    try
    {
    if(this.ReportName != "")
    {
    //报表路径
    string ReportPath = Request.ServerVariables["APPL_PHYSICAL_PATH"];
    ReportPath += "Reports\\" + ReportName + ".rpt"; if(!File.Exists(ReportPath))
    {
    //01.010.00002 = 报表文件不存在
    UIUtil.ShowErrorMessage(Page,base.SysParams[3],"01.010.00001");
    return;
    }
    crReportDocument.Load(ReportPath) ;
    UpdatePrintOptions(); //连接数据库
    //server=proserver;uid=sa;pwd=123;database=ps_data
    char[] chSplit = {'=',';'};
    string[] strInfos = base.SysParams[2].Split(chSplit); //登录数据库
    //this.ConnectDataBase(strInfos[1],strInfos[7],strInfos[3],strInfos[5]); //重新设定数据源
    SearchBase searchBase = RptFactory.BuildSearchClass(this.ReportName); 
    System.Diagnostics.Debug.Assert(searchBase != null);
    DataSet ds = searchBase.GetPrintDataSet(SysParams,(ConditionCollection)Session["SearchCondition"]);
    if(!System.DBNull.Value.Equals(ds) && ds.Tables.Count > 0)
    {
    crReportDocument.SetDataSource(ds.Tables[0]);
    crReportDocument.Refresh();
    }
                        
    //获得报表参数
    GetParams(searchBase); //显示报表
    this.CrystalReportViewer1.ReportSource = crReportDocument;
    this.CrystalReportViewer1.DataBind();
    }
    }
    catch(EngineException ee)
    {
    if(ee.ErrorID == EngineExceptionErrorID.LogOnFailed)
    {
    //登录错误
    UIUtil.ShowErrorMessage(Page,base.SysParams[3],"01.010.00002");
    }
    else if(ee.ErrorID == EngineExceptionErrorID.DataSourceError)
    {
    //数据源错误
    UIUtil.ShowErrorMessage(Page,base.SysParams[3],"01.010.00002");
    }
    else
    {
    //抛出系统异常
    throw new Exception(ee.Message );
    }
    }
    }