示例#1
0
        private void btnSelectReport_Click(object sender, EventArgs e)
        {
            BAL.Reports b     = new BAL.Reports();
            DataTable   table = (DataTable)b.SelectDepartmentThroughBankID(Convert.ToInt32(comboBox1.SelectedValue));

            using (DepartmentSalaryReport report = new DepartmentSalaryReport())
            {
                report.SetDataSource(table);
                crystalReportViewer1.ReportSource = report;
                crystalReportViewer1.Refresh();
            }
        }
 private void button1_Click(object sender, EventArgs e)
 {
     BAL.Reports s = new BAL.Reports();
     using (DataTable table = s.SelectDepartmentThroughBankID(Convert.ToInt32(comboBox1.SelectedValue)))
     {
         using (Reports.DepartmentSalaryChart chart = new Reports.DepartmentSalaryChart())
         {
             chart.SetDataSource(table);
             crystalReportViewer1.ReportSource = chart;
             crystalReportViewer1.Refresh();
         }
     }
 }