예제 #1
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
     RptCustomerTrans rpt = new RptCustomerTrans();
     rpt.Site = this.Site;
     return rpt;
 }
예제 #2
0
        private void btnShowReport_Click(object sender, EventArgs e)
        {
            objRpt = new RptCustomerTrans();

            string query = CreateSelectQueryAndParameters();

            if (!query.Contains("Column"))
            {
                MessageBox.Show("No selection to display!");
                return;
            }

            try
            {
                SqlConnection con = new SqlConnection(VisitaJayaPerkasa.Constant.VisitaJayaPerkasaApplication.connectionString);

                SqlDataAdapter da = new SqlDataAdapter(query, VisitaJayaPerkasa.Constant.VisitaJayaPerkasaApplication.connectionString);
                ShippingMainDataSet ds = new ShippingMainDataSet();
                da.Fill(ds, "CUSTOMER_TRANS");

                objRpt.SetDataSource(ds);
                crystalReportViewer1.ReportSource = objRpt;
            }
            catch (SqlException sqlEx)
            {
                MessageBox.Show(sqlEx.Message);
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message);
            }
        }