protected void Page_Load(object sender, EventArgs e) { ReporBin = new ReportBiningata(); CompInfo = ReporBin.GetCompanyInf(); Area = ReporBin.GetArea(); // ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Area", Area)); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("CompInfo", CompInfo)); // ReportViewer1.LocalReport.ReportPath = @"Reportes\Area\AreaReport.rdlc"; this.ReportViewer1.LocalReport.DisplayName = "Report about Areas"; this.ReportViewer1.LocalReport.Refresh(); }
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { ///ReportViewer2.Reset(); ReporBin = new ReportBiningata(); ReportViewer2.LocalReport.DataSources.Clear(); CompInfo = ReporBin.GetCompanyInf(); Car = ReporBin.GetCars(DropDownList1.SelectedValue.ToString()); Cu_Sluts = ReporBin.GetCu_Slot(DropDownList1.SelectedValue.ToString()); Customer = ReporBin.Get_Cust(DropDownList1.SelectedValue.ToString()); this.ReportViewer2.LocalReport.DataSources.Add(new ReportDataSource("Customer", Customer)); this.ReportViewer2.LocalReport.DataSources.Add(new ReportDataSource("Car", Car)); this.ReportViewer2.LocalReport.DataSources.Add(new ReportDataSource("Cu_Sluts", Cu_Sluts)); this.ReportViewer2.LocalReport.DataSources.Add(new ReportDataSource("CompInfo", CompInfo)); this.ReportViewer2.LocalReport.DisplayName = "Report About Customer " + DropDownList1.SelectedItem.Text; this.ReportViewer2.LocalReport.Refresh(); }