コード例 #1
0
        private void label7_Click(object sender, EventArgs e)
        {
            //All Members
            CrystalDecisions.Shared.TableLogOnInfo li;

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


                SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM vw_MembershipReport WHERE IsApprove ='1' and IsActive = '1' and Company_Code <> 'COMP010' ORDER BY Company", con);

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

                ReportsForms.rptMembershipMainPage cr  = new ReportsForms.rptMembershipMainPage();
                ReportsForms.rptMembershipMain     rpt = new ReportsForms.rptMembershipMain();

                li = new TableLogOnInfo();

                li.ConnectionInfo.IntegratedSecurity = false;

                adapter.Fill(ds, "vw_MembershipReport");
                dt = ds.Tables["vw_MembershipReport"];
                cr.SetDataSource(ds.Tables["vw_MembershipReport"]);
                cr.SetParameterValue("status", "Active Members");

                //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.ShowDialog();
            }
        }
コード例 #2
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rptMembershipMainPage rpt = new rptMembershipMainPage();

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