Beispiel #1
0
        public void Read(string addgroup, string mon, string jo)
        {
            SqlConnection conn = new SqlConnection(this.connectionString);
            SqlCommand comm = new SqlCommand("dbo.UspBankAdviseReport", conn);
            comm.CommandType = CommandType.StoredProcedure;

            comm.Parameters.Add("@SalaryYear", SqlDbType.VarChar, 50);
            comm.Parameters["@SalaryYear"].Value = comboBox2.Text;

            comm.Parameters.Add("@SalaryMonth", SqlDbType.VarChar, 50);
            comm.Parameters["@SalaryMonth"].Value = comboBox4.Text;

            comm.Parameters.Add("@Bank", SqlDbType.VarChar, 50);
            comm.Parameters["@Bank"].Value = comboBox1.Text;

            SqlDataAdapter adap = new SqlDataAdapter();
            DatabaseDataSet dataset = new DatabaseDataSet();
            BankCrystalReport crp = new BankCrystalReport();

            try
            {
                conn.Open();
                adap.SelectCommand = comm;
                adap.Fill(dataset, "DataTable1");
                crp.SetDataSource(dataset);
                crystalReportViewer1.ReportSource = crp;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
            finally
            {
                conn.Close();
            }
        }
Beispiel #2
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     BankCrystalReport rpt = new BankCrystalReport();
     rpt.Site = this.Site;
     return rpt;
 }