private void frmPhieuThuVon_Load(object sender, EventArgs e)
        {
            PhieuThuNo rpt = new PhieuThuNo();

            CrystalDecisions.CrystalReports.Engine.Table tblCurrent;
            CrystalDecisions.Shared.TableLogOnInfo       tliCurrent = new CrystalDecisions.Shared.TableLogOnInfo();
            DataService InfoSQL = new DataService();

            try
            {
                for (int i = 0; i < rpt.Database.Tables.Count; i++)
                {
                    tblCurrent = rpt.Database.Tables[i];
                    tliCurrent.ConnectionInfo.ServerName   = InfoSQL.servername;
                    tliCurrent.ConnectionInfo.UserID       = InfoSQL.username;
                    tliCurrent.ConnectionInfo.Password     = InfoSQL.password;
                    tliCurrent.ConnectionInfo.DatabaseName = InfoSQL.database;
                    //if(InfoSQL.security.Equals("True"))
                    tliCurrent.ConnectionInfo.IntegratedSecurity = Convert.ToBoolean(InfoSQL.security);
                    tblCurrent.ApplyLogOnInfo(tliCurrent);
                }
            }
            catch { }

            crystalReportViewer1.ReportSource = rpt;
        }
Ejemplo n.º 2
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            PhieuThuNo rpt = new PhieuThuNo();

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