水晶报表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;

        }

你可能感兴趣的:(VS2010)