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

            rpt.Site = this.Site;
            return(rpt);
        }
コード例 #2
0
        private void btnGenerateReport_Click(object sender, EventArgs e)
        {
            DataSet1   ds  = new DataSet1();
            SqlCommand cmd = con.CreateCommand();

            cmd.CommandType = CommandType.Text;
            //cmd.CommandText = "select * from issue_books where books_return_date=''";
            cmd.CommandText = "select * from issue_books inner join user_details on issue_books.UID = user_details.UID inner join books_info on issue_books.books_Id = books_info.books_Id where books_return_date=''";
            cmd.ExecuteNonQuery();
            DataTable      dt = new DataTable();
            SqlDataAdapter da = new SqlDataAdapter(cmd);

            da.Fill(ds.issue_list);
            CrystalReport1 myreport = new CrystalReport1();

            myreport.SetDataSource(ds);
            crystalReportViewer1.ReportSource = myreport;
        }
コード例 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            DataSet1   ds  = new DataSet1();
            SqlCommand cmd = con.CreateCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select * from issue_book where book_return_date= ' '";
            cmd.ExecuteNonQuery();
            DataTable      dt = new DataTable();
            SqlDataAdapter da = new SqlDataAdapter(cmd);

            da.Fill(ds.DataTable1);
            CrystalReport1 cp = new CrystalReport1();

            cp.SetDataSource(ds);
            CrystalReportViewer1 cpv = new CrystalReportViewer1();

            crystalReportViewer1.ReportSource = cp;
        }