protected void displayItemByQuery(String s) { db_connection db_obj = new db_connection(); db_obj.open(); //********************** itemReport.ProcessingMode = ProcessingMode.Local; itemReport.LocalReport.ReportPath = Server.MapPath("~/itemReport.rdlc"); itemDataSet item_Dataset = new itemDataSet(); SqlDataAdapter da = new SqlDataAdapter(s, db_obj.connection); DataTable dt = new DataTable(); da.Fill(item_Dataset, item_Dataset.Tables[0].TableName); dt = item_Dataset.Tables[0]; // //YouTube. 2016. crystal report,how to create crystal report in C# net using Dataset,visual studio - YouTube. [ONLINE] Available at: https://www.youtube.com/watch?v=uRICO1sZ3Hc. [Accessed 10 Nov 2017]. ReportDataSource ReportDataSource = new ReportDataSource("item_services", item_Dataset.Tables[0]); this.itemReport.LocalReport.DataSources.Clear(); this.itemReport.LocalReport.DataSources.Add(ReportDataSource); this.itemReport.LocalReport.Refresh(); Generatereport(dt); //*** // this.userReport.ReportRefresh(); //************************ db_obj.close(); }
protected void displayAllItem() { db_connection db_obj = new db_connection(); db_obj.open(); //********************** itemReport.ProcessingMode = ProcessingMode.Local; itemReport.LocalReport.ReportPath = Server.MapPath("~/itemReport.rdlc"); itemDataSet item_Dataset = new itemDataSet(); string s = "SELECT [item_id],[venue],[item_name],[description],[location_id],[available_time],[date],[status],[type],[added_by],[unit_price],[img] FROM [item_services];"; SqlDataAdapter da = new SqlDataAdapter(s, db_obj.connection); DataTable dt = new DataTable(); da.Fill(item_Dataset, item_Dataset.Tables[0].TableName); dt = item_Dataset.Tables[0]; // //YouTube. 2016. crystal report,how to create crystal report in C# net using Dataset,visual studio - YouTube. [ONLINE] Available at: https://www.youtube.com/watch?v=uRICO1sZ3Hc. [Accessed 10 Nov 2017]. ReportDataSource ReportDataSource = new ReportDataSource("item_services", item_Dataset.Tables[0]); this.itemReport.LocalReport.DataSources.Clear(); this.itemReport.LocalReport.DataSources.Add(ReportDataSource); this.itemReport.LocalReport.Refresh(); Generatereport(dt); //*** // this.userReport.ReportRefresh(); //************************ db_obj.close(); }