コード例 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            SalesReport rpt = new SalesReport();

            rpt.Site = this.Site;
            return(rpt);
        }
コード例 #2
0
        private void SalesReportMonth_Load(object sender, EventArgs e)
        {
            try
            {
                SqlConnection sqlcon = new SqlConnection(conn);
                sqlcon.Open();
                string query = @"select * from BillOrder where 
              BillDate >= '" + SD + "' and BillDate <= '" + ED + "'";

                SqlDataAdapter sda = new SqlDataAdapter(query, sqlcon);
                DataSet        ds  = new DataSet();
                sda.Fill(ds, "BillOrder");
                SalesReport cr1 = new SalesReport();
                cr1.SetDataSource(ds);
                crystalReportViewer1.ReportSource = cr1;
                crystalReportViewer1.Refresh();
            }
            catch (Exception ex)
            {
                throw; MessageBox.Show(string.Format("An error occurred: {0}", ex.Message));
            }
        }