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

            rpt.Site = this.Site;
            return(rpt);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor; //untuk kursor pada report

            //int col = 0; //karena diambil dari kolom id
            int row = dataGridView1.SelectedCells[0].RowIndex; //nomor
            //int id = (int)dataGridView1[col, row].Value;

            DS_library ds = new DS_library(); //nama dataset yang dibuat

            //DataTable dt = new DataTable();

            DS_libraryTableAdapters.tbl_bukuTableAdapter     b = new DS_libraryTableAdapters.tbl_bukuTableAdapter();
            DS_libraryTableAdapters.tbl_kategoriTableAdapter k = new DS_libraryTableAdapters.tbl_kategoriTableAdapter();

            b.FillBy(ds.tbl_buku);
            k.FillBy(ds.tbl_kategori);

            ReportClass rpt = new CR_Library(); //mengambil .rpt

            rpt.Database.Tables["tbl_buku"].SetDataSource(ds.Tables[0]);
            rpt.Database.Tables["tbl_kategori"].SetDataSource(ds.Tables[1]);

            rpt.SetDataSource(ds); //menyimpan ds ke dalam report

            Form f1 = new TampilanLaporan(rpt);

            //Form f1 = new TampilanLaporan();
            f1.ShowDialog();
        }