private void SearchChekoutReportViewPort_Load(object sender, EventArgs e)
        {
            try
            {
                Selection selectionInstance = Application.OpenForms.OfType <Selection>().FirstOrDefault();

                string list_of_ids_with_comma = "";

                if (selectionInstance != null)
                {
                    List <int> ids = selectionInstance.getSlideIDs();
                    ids.ForEach(delegate(int sid)
                    {
                        list_of_ids_with_comma += sid + ",";
                    });

                    list_of_ids_with_comma = list_of_ids_with_comma.Remove(list_of_ids_with_comma.Length - 1);//reove tge kaqst ,
                }

                //added created date as filter of todays eneter slides
                String         query       = "  SELECT * from current_lending c inner join slides as s on s.id = c.slide_id inner join donors as d on d.id = s.donor_id inner join contacts as b on b.id = c.borrower_id inner join species_specifics as ss on ss.id = d.species_specific_id inner join species_category as sc on sc.id = d.species_catgeroy_id  inner join species_stages as st on st.id = d.species_stage_id inner join density_category as dc on dc.id = d.density_category_id  WHERE c.isHistory = 0 and c.reason <> 'Exchange' and s.id IN (" + list_of_ids_with_comma + ")";
                SqlDataAdapter dataAdapter = new SqlDataAdapter(query, DBConnectionSingltonServices.GetConnection());
                dataAdapter.SelectCommand.CommandText = query;
                DataTable sqldatatable = new DataTable();
                dataAdapter.Fill(sqldatatable);
                CrystalReportSearchCheckout crystalReportSearchCheckout = new CrystalReportSearchCheckout();
                crystalReportSearchCheckout.Database.Tables["checkedout_slides_details"].SetDataSource(sqldatatable);
                crystalReportViewer1.ReportSource = crystalReportSearchCheckout;
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Checkout Report generation has some expections");
            }
        }
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CrystalReportSearchCheckout rpt = new CrystalReportSearchCheckout();

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