Beispiel #1
0
        public void ProductList(DataTable dt, int vStyle)
        {
            try
            {
                objDAL.connectionstring = System.Configuration.ConfigurationManager.ConnectionStrings["MyString"].ConnectionString;
                DataTable dt1 = objDAL.getCompanyInfo();

                if (vStyle == 0)
                {
                    CrpProductList Rpt = new CrpProductList();
                    Rpt.Database.Tables[0].SetDataSource(dt);
                    Rpt.Database.Tables[1].SetDataSource(dt1);
                    this.CRViewer.ReportSource = Rpt;
                }
                else if (vStyle == 1)
                {
                    CrpProductListP Rpt = new CrpProductListP();
                    Rpt.Database.Tables[0].SetDataSource(dt);
                    Rpt.Database.Tables[1].SetDataSource(dt1);
                    this.CRViewer.ReportSource = Rpt;
                }
                else if (vStyle == 2)
                {
                    CrpProductListS Rpt = new CrpProductListS();
                    Rpt.Database.Tables[0].SetDataSource(dt);
                    Rpt.Database.Tables[1].SetDataSource(dt1);
                    this.CRViewer.ReportSource = Rpt;
                }
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message, "Error");
            }
        }
Beispiel #2
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CrpProductListP rpt = new CrpProductListP();

            rpt.Site = this.Site;
            return(rpt);
        }