private void ReportViewer_Load(object sender, EventArgs e) { if (!_isReportViewerLoaded) { Microsoft.Reporting.WinForms.ReportDataSource reportDataSource1 = new Microsoft.Reporting.WinForms.ReportDataSource(); Database1DataSet dataset = new Database1DataSet(); dataset.BeginInit(); reportDataSource1.Name = "DataSet1"; reportDataSource1.Value = dataset.Work; this.reportViewer.LocalReport.DataSources.Add(reportDataSource1); this.reportViewer.LocalReport.ReportEmbeddedResource = "KFIRKK.Report1.rdlc"; dataset.EndInit(); //fill data into adventureWorksDataSet Database1DataSetTableAdapters.WorkTableAdapter salesOrderDetailTableAdapter = new Database1DataSetTableAdapters.WorkTableAdapter(); salesOrderDetailTableAdapter.ClearBeforeFill = true; salesOrderDetailTableAdapter.Fill(dataset.Work); reportViewer.RefreshReport(); _isReportViewerLoaded = true; } }
/// <summary> /// get states with IN operator /// </summary> /// <param name="names"></param> /// <returns></returns> public ICollection <State> getWithInOperator(IEnumerable <string> names) { var dataset = new Database1DataSet { EnforceConstraints = false }; dataset.BeginInit(); this.manager.StatesTableAdapter.FillByInOperator(dataset.States, names); dataset.EndInit(); var result = prepareStates(dataset.States); dataset.Dispose(); return(result); }
/// <summary> /// get all states /// </summary> /// <returns>all states</returns> public ICollection <State> getAll() { var dataset = new Database1DataSet { EnforceConstraints = false }; dataset.BeginInit(); this.manager.StatesTableAdapter.Fill(dataset.States); dataset.EndInit(); var result = prepareStates(dataset.States); dataset.Dispose(); return(result); }