private void frmPrintUserPay_Load(object sender, EventArgs e) {
//数据集: liuxw_MPS.PMSDataSet.PayDataSet ds = new PMSDataSet.PayDataSet(); liuxw_MPS.PMSDataSet.PayDataSetTableAdapters.tb_payTableAdapter ada = new PMSDataSet.PayDataSetTableAdapters.tb_payTableAdapter();
//数据库连接:
ada.Connection = DBConnection.getConnection();
//填充:
if (this.Month == null || this.Month == "")//全部工资;
ada.Fill(ds.tb_pay);
else
ada.FillByMonth(ds.tb_pay, this.Month);//指定月份工资;
PayReport pr = new PayReport();
pr.SetDataSource(ds);
crystalReportViewer1.ReportSource = pr;//显示报表;
}