예제 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            BookReport rpt = new BookReport();

            rpt.Site = this.Site;
            return(rpt);
        }
예제 #2
0
        private void frmBookReport_Load(object sender, EventArgs e)
        {
            ArrayList books = null;

            if (this.books != null)
            {
                books = this.books;
            }
            else
            {
                DatabaseUtility.getBookByName(ref books, "_");
            }

            YggdrasilDataSet ds = new YggdrasilDataSet();
            BookReport       cr = new BookReport();

            foreach (Book book in books)
            {
                DataRow r = ds.Tables["book"].NewRow();
                r[0] = book.Book_id;
                r[1] = book.Book_name;
                r[2] = book.Location;
                if (book.Book_status == 1)
                {
                    r[3] = "on shelf";
                }
                else
                {
                    r[3] = "off shelf";
                }
                if (book.Publisher != null)
                {
                    r[4] = book.Publisher.Publisher_name;
                }
                else
                {
                    r[4] = null;
                }
                r[5] = book.Chapter_no;
                r[6] = book.Create_date;
                r[7] = book.Modify_date;
                r[8] = book.getInfo();
                r[9] = book.getCoverInByte();
                ds.Tables["book"].Rows.Add(r);
            }

            cr.SetDataSource(ds);
            crystalReportViewer1.ReportSource = cr;
        }