Example #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rptCashDaily rpt = new rptCashDaily();

            rpt.Site = this.Site;
            return(rpt);
        }
        private void label7_Click(object sender, EventArgs e)
        {
            //CASH REPORT
            CrystalDecisions.Shared.TableLogOnInfo li;

            //Print Purposes
            using (SqlConnection con = new SqlConnection(global.connectString()))
            {
                con.Open();

                SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM vw_SavingsReportDailyCA", con);



                DataTable dt = new DataTable();
                DataSet   ds = new DataSet();

                ReportsForms.rptCashDaily cr = new ReportsForms.rptCashDaily();
                ReportsForms.rptSavingsWithdrawalDaily rpt = new ReportsForms.rptSavingsWithdrawalDaily();

                li = new TableLogOnInfo();

                li.ConnectionInfo.IntegratedSecurity = false;

                adapter.Fill(ds, "vw_SavingsReportDailyCA");
                dt = ds.Tables["vw_SavingsReportDailyCA"];
                cr.SetDataSource(ds.Tables["vw_SavingsReportDailyCA"]);

                //cr.SetDatabaseLogon("sa", "SYSADMIN", "192.168.255.176", "PECCI-NEW");
                cr.SetDatabaseLogon(global.username, global.pass, global.datasource, global.initialCatalog);

                rpt.crystalReportViewer1.ReportSource = cr;
                rpt.crystalReportViewer1.RefreshReport();
                rpt.ShowDialog();
            }
        }