public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            AccountCrystalReport1 rpt = new AccountCrystalReport1();

            rpt.Site = this.Site;
            return(rpt);
        }
Example #2
0
        private void showreportbutton_Click(object sender, EventArgs e)
        {
            SqlConnection connction = new SqlConnection();
            string        Link      = @"Data Source = DESKTOP-6LMCH95\SQLEXPRESS;Database = SMS;Integrated Security = SSPI";

            connction.ConnectionString = Link;
            connction.Open();

            string         query = "Select AID,AdmissonFee,SemisterFee,TutionFee,TotalPaid,Due,Waiver From Account";
            SqlCommand     cmd   = new SqlCommand(query, connction);
            SqlDataAdapter sda   = new SqlDataAdapter();
            DataTable      dt    = new DataTable();

            sda.SelectCommand = cmd;
            sda.Fill(dt);

            AccountCrystalReport1 aCR = new AccountCrystalReport1();

            aCR.SetDataSource(dt);
            crystalReportViewer2.ReportSource = aCR;
        }