水晶报表VS2010防止出现用户登录问题

 

1、联合查询,采用视图办法

2、借用如下语句

using CrystalDecisions.CrystalReports.Engine;

using CrystalDecisions.Shared;

        public frmXsjfDy(string sqlpublic)

        {

            InitializeComponent();

            DBClass db = new DBClass();

           

            DataSet ds = db.GetDataSet(sqlpublic);

            ReportDocument rpt = new ReportDocument();

            if (ds.Tables.Count <= 0)

            {

                sqlpublic = "select * from sfglb";

                ds = db.GetDataSet(sqlpublic);

            }

            rpt.Load("crXsjf.rpt");

            rpt.SetDataSource(ds.Tables[0]);

            crystalReportViewer1.ReportSource = rpt;

        }

posted @ 2014-07-17 21:01  "幸 福 。  阅读(163)  评论(0编辑  收藏  举报