protected void btnGetReport_Click(object sender, EventArgs e) { string Staff = string.Empty; string FromDate = string.Empty; string ToDate = string.Empty; string strCourseName = string.Empty; Staff = ddlStaff.Items[ddlStaff.SelectedIndex].Value; if(txtFromDate.Text!="") FromDate =ChangeDateFormat(txtFromDate.Text); if(txtToDate.Text!="") ToDate =ChangeDateFormat(txtToDate.Text); strCourseName = txtCourseName.Text; StaffTrainingReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; StaffTrainingReportViewer.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportsURI"].ToString()); StaffTrainingReportViewer.ServerReport.ReportPath =ConfigurationManager.AppSettings["ReportsFolder"].ToString()+ "StaffTrainingCourses"; StaffTrainingReportViewer.ShowParameterPrompts = false; StaffTrainingReportViewer.ShowPrintButton = true; StaffTrainingReportViewer.ShowToolBar = true; StaffTrainingReportViewer.SizeToReportContent = true; Microsoft.Reporting.WebForms.ReportParameter[] StaffTrainingCourseParam = new Microsoft.Reporting.WebForms.ReportParameter[4]; StaffTrainingCourseParam[0] = new Microsoft.Reporting.WebForms.ReportParameter("Staff", Staff); StaffTrainingCourseParam[1] = new Microsoft.Reporting.WebForms.ReportParameter("CourseName",strCourseName); StaffTrainingCourseParam[2] = new Microsoft.Reporting.WebForms.ReportParameter("FromDate", FromDate); StaffTrainingCourseParam[3] = new Microsoft.Reporting.WebForms.ReportParameter("ToDate", ToDate); StaffTrainingReportViewer.ServerReport.SetParameters(StaffTrainingCourseParam); StaffTrainingReportViewer.ServerReport.Refresh(); }
protected void btnReport_Click(object sender, EventArgs e) { string FullName = string.Empty, Month = string.Empty, Year = string.Empty; FullName = ddlStaff.Items[ddlStaff.SelectedIndex].Value; Month = ddlMonth.Items[ddlMonth.SelectedIndex].Value; Year = ddlYear.Items[ddlYear.SelectedIndex].Value; MyReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; MyReportViewer.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportsURI"].ToString()); // Report Server URL MyReportViewer.ServerReport.ReportPath = ConfigurationManager.AppSettings["ReportsFolder"].ToString() + "StaffPayslipReport"; // Report Name MyReportViewer.ShowParameterPrompts = false; MyReportViewer.ShowPrintButton = true; MyReportViewer.ShowToolBar = true; // Below code demonstrate the Parameter passing method. User only if you have parameters into the reports. Microsoft.Reporting.WebForms.ReportParameter[] reportParameterCollection = new Microsoft.Reporting.WebForms.ReportParameter[3]; reportParameterCollection[0] = new Microsoft.Reporting.WebForms.ReportParameter("StaffID", FullName); reportParameterCollection[1] = new Microsoft.Reporting.WebForms.ReportParameter("Month", Month); reportParameterCollection[2] = new Microsoft.Reporting.WebForms.ReportParameter("Years", Year); MyReportViewer.ServerReport.SetParameters(reportParameterCollection); MyReportViewer.ServerReport.Refresh(); }
protected override void OnInit(EventArgs e) { base.OnInit(e); //Microsoft.Reporting.WebForms.ReportViewer reportViewer1 = //(Microsoft.Reporting.WebForms.ReportViewer)sender; Microsoft.Reporting.WebForms.ReportViewer reportViewer1 = this.ReportViewer1; string s = " 上記の業務委託について、ああああああと受注者(株)あいうえお建設は、各々の対等な立場における合意に基づいて、別添のうううううううううううによって委託契約を締結し、信義に従って誠実にこれを履行するものとする。"; s = ToJustifyText(s); List <Microsoft.Reporting.WebForms.ReportParameter> list = new List <Microsoft.Reporting.WebForms.ReportParameter>(); foreach (Microsoft.Reporting.WebForms.ReportParameterInfo rpi in reportViewer1.LocalReport.GetParameters()) { Microsoft.Reporting.WebForms.ReportParameter rp = new Microsoft.Reporting.WebForms.ReportParameter(rpi.Name, s); list.Add(rp); } foreach (string name in this.ReportViewer1.LocalReport.GetDataSourceNames()) { DataSet1.DataTable1DataTable dt = new DataSet1.DataTable1DataTable(); var row = dt.NewDataTable1Row(); row.DataColumn1 = s; dt.Rows.Add(row); row = dt.NewDataTable1Row(); row.DataColumn1 = ToJustifyText(s); dt.Rows.Add(row); reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource(name, (System.Collections.IEnumerable)dt)); } reportViewer1.DataBind(); reportViewer1.LocalReport.SetParameters(list); }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { RPT_UserLog.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_UserLog.ServerReport; Microsoft.Reporting.WebForms.ReportParameter ORGANISATION; string sDomain = System.Configuration.ConfigurationSettings.AppSettings["MyReportViewerDomain"]; WebClient Wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); ORGANISATION = new Microsoft.Reporting.WebForms.ReportParameter("ORGANISATION", Convert.ToString(Session["EMP_ORGANISATION_ID"])); Microsoft.Reporting.WebForms.ReportParameter[] parameters = { ORGANISATION }; serverReport.SetParameters(parameters); serverReport.Refresh(); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "UserLog", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btnGetReport_Click(object sender, EventArgs e) { string Transaction = string.Empty; string FromDate = string.Empty; string ToDate = string.Empty; string Planned = string.Empty; Transaction = ddlTransaction.Items[ddlTransaction.SelectedIndex].Value; if (txtFromDate.Text != "") FromDate =ChangeDateFormat(txtFromDate.Text); if (txtToDate.Text != "") ToDate = ChangeDateFormat(txtToDate.Text); Planned = ddlPlanNon.Items[ddlPlanNon.SelectedIndex].Value; cashBookReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; cashBookReportViewer.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportsURI"].ToString()); cashBookReportViewer.ServerReport.ReportPath = ConfigurationManager.AppSettings["ReportsFolder"].ToString() + "AccountCashBookReport"; cashBookReportViewer.ShowParameterPrompts = false; cashBookReportViewer.ShowPrintButton = true; cashBookReportViewer.ShowToolBar = true; cashBookReportViewer.SizeToReportContent = true; Microsoft.Reporting.WebForms.ReportParameter[] cashBookParam = new Microsoft.Reporting.WebForms.ReportParameter[4]; cashBookParam[0] = new Microsoft.Reporting.WebForms.ReportParameter("TransactionType", Transaction); cashBookParam[1] = new Microsoft.Reporting.WebForms.ReportParameter("FromDate", FromDate); cashBookParam[2] = new Microsoft.Reporting.WebForms.ReportParameter("ToDate", ToDate); cashBookParam[3] = new Microsoft.Reporting.WebForms.ReportParameter("PlanNonPlan", Planned); cashBookReportViewer.ServerReport.SetParameters(cashBookParam); cashBookReportViewer.ServerReport.Refresh(); }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { string cargoCode = Request.QueryString["cargoCode"].ToString().Trim(); string cargoName = Request.QueryString["cargoName"].ToString().Trim(); string modelName = Request.QueryString["modelName"].ToString().Trim(); string specName = Request.QueryString["specName"].ToString().Trim(); string saleStatusStr = Request.QueryString["saleStatusStr"].ToString().Trim(); int saleStatus = -1; if (!string.IsNullOrEmpty(saleStatusStr)) { if (int.TryParse(saleStatusStr, out saleStatus) == false) { saleStatus = -1; } } using (DAL.GoldEntities context = new DAL.GoldEntities()) { List <DAL.proc_WebSelectEachDeptSaleAllocation_Result> resultList = context.proc_WebSelectEachDeptSaleAllocation().ToList <DAL.proc_WebSelectEachDeptSaleAllocation_Result>(); var queryResult = (from r in resultList where r.CargoCode.Contains(cargoCode) && r.CargoName.Contains(cargoName) && r.CargoModel.Contains(modelName) && r.CargoSpec.Contains(specName) && (saleStatus >= 0 ? r.SaleStatus == saleStatus : 1 == 1) select r).ToList(); Microsoft.Reporting.WebForms.ReportDataSource rds = new Microsoft.Reporting.WebForms.ReportDataSource("DataSet1", queryResult); ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.DataSources.Add(rds); Microsoft.Reporting.WebForms.ReportParameter ReportParameter_CargoCode = new Microsoft.Reporting.WebForms.ReportParameter("ReportParameter_CargoCode", cargoCode); Microsoft.Reporting.WebForms.ReportParameter ReportParameter_CargoName = new Microsoft.Reporting.WebForms.ReportParameter("ReportParameter_CargoName", cargoName); Microsoft.Reporting.WebForms.ReportParameter ReportParameter_CargoModel = new Microsoft.Reporting.WebForms.ReportParameter("ReportParameter_CargoModel", modelName); Microsoft.Reporting.WebForms.ReportParameter ReportParameter_CargoSpec = new Microsoft.Reporting.WebForms.ReportParameter("ReportParameter_CargoSpec", specName); Microsoft.Reporting.WebForms.ReportParameter ReportParameter_SaleStatus = new Microsoft.Reporting.WebForms.ReportParameter("ReportParameter_SaleStatus", saleStatus >= 0 ? (saleStatus > 0?"可售":"不可售"): ""); Microsoft.Reporting.WebForms.ReportParameterCollection rpList = new Microsoft.Reporting.WebForms.ReportParameterCollection(); rpList.Add(ReportParameter_CargoCode); rpList.Add(ReportParameter_CargoName); rpList.Add(ReportParameter_CargoModel); rpList.Add(ReportParameter_CargoSpec); rpList.Add(ReportParameter_SaleStatus); ReportViewer1.LocalReport.SetParameters(rpList); ReportViewer1.DataBind(); } } } catch (Exception ex) { lblGridViewMsg.Text = Utility.LogHelper.GetExceptionMsg(ex); } }
protected void btnReport_Click(object sender, EventArgs e) { string Batch = string.Empty, Class = string.Empty, Section = string.Empty, Student = string.Empty, From = string.Empty, To = string.Empty; Batch = ddlBatch.Items[ddlBatch.SelectedIndex].Value; Class = ddlClasses.Items[ddlClasses.SelectedIndex].Value; Section = ddlSections.Items[ddlSections.SelectedIndex].Value; Student = ddlStudent.Items[ddlStudent.SelectedIndex].Value; if (txtFromDate.Text != "") From = ChangeDateFormat(txtFromDate.Text); else From = " "; if (txtToDate.Text != "") To = ChangeDateFormat(txtToDate.Text); else To = " "; MyReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; MyReportViewer.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportsURI"].ToString()); // Report Server URL MyReportViewer.ServerReport.ReportPath = ConfigurationManager.AppSettings["ReportsFolder"].ToString() + "StudentProdIssue"; // Report Name MyReportViewer.ShowParameterPrompts = false; MyReportViewer.ShowPrintButton = true; MyReportViewer.ShowToolBar = true; MyReportViewer.SizeToReportContent = true; // Below code demonstrate the Parameter passing method. User only if you have parameters into the reports. Microsoft.Reporting.WebForms.ReportParameter[] reportParameterCollection = new Microsoft.Reporting.WebForms.ReportParameter[6]; reportParameterCollection[0] = new Microsoft.Reporting.WebForms.ReportParameter("Batch", Batch); reportParameterCollection[1] = new Microsoft.Reporting.WebForms.ReportParameter("Class", Class); reportParameterCollection[2] = new Microsoft.Reporting.WebForms.ReportParameter("Section", Section); reportParameterCollection[3] = new Microsoft.Reporting.WebForms.ReportParameter("Student", Student); reportParameterCollection[4] = new Microsoft.Reporting.WebForms.ReportParameter("Fromdate", From); reportParameterCollection[5] = new Microsoft.Reporting.WebForms.ReportParameter("Todate", To); MyReportViewer.ServerReport.SetParameters(reportParameterCollection); MyReportViewer.ServerReport.Refresh(); }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { RPT_EmployeeSkill.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_EmployeeSkill.ServerReport; Microsoft.Reporting.WebForms.ReportParameter Organisation; Microsoft.Reporting.WebForms.ReportParameter BUSINESSUNIT; Microsoft.Reporting.WebForms.ReportParameter EMPLOYEE; Microsoft.Reporting.WebForms.ReportParameter SKILLS; string sDomain = System.Configuration.ConfigurationSettings.AppSettings["MyReportViewerDomain"]; WebClient Wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); string MyReportPath = System.Configuration.ConfigurationSettings.AppSettings["MyReportPath"]; serverReport.ReportPath = MyReportPath + "Employee_Skills_Report"; if (Convert.ToString(Request.QueryString["BU"]) != "") { BUSINESSUNIT = new Microsoft.Reporting.WebForms.ReportParameter("BUSINESSUNIT", Convert.ToString(Request.QueryString["BU"])); } else { BUSINESSUNIT = new Microsoft.Reporting.WebForms.ReportParameter("BUSINESSUNIT", "-1"); } if (Convert.ToString(Request.QueryString["EMP"]) != "") { EMPLOYEE = new Microsoft.Reporting.WebForms.ReportParameter("EMPLOYEE", Convert.ToString(Request.QueryString["EMP"])); } else { EMPLOYEE = new Microsoft.Reporting.WebForms.ReportParameter("EMPLOYEE", "-1"); } if (Convert.ToString(Request.QueryString["SKL"]) != "") { SKILLS = new Microsoft.Reporting.WebForms.ReportParameter("SKILLS", Convert.ToString(Request.QueryString["SKL"])); } else { SKILLS = new Microsoft.Reporting.WebForms.ReportParameter("SKILLS", "-1"); } Organisation = new Microsoft.Reporting.WebForms.ReportParameter("ORGANISATION", Convert.ToString(Session["ORG_ID"])); Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Organisation, BUSINESSUNIT, EMPLOYEE, SKILLS }; serverReport.SetParameters(parameters); serverReport.Refresh(); RPT_EmployeeSkill.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "EmployeeSkillReport", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btnReport_Click(object sender, EventArgs e) { foreach (GridViewRow gvr in gdvStud.Rows) { Label lblStudId = new Label(); RadioButton rdb = new RadioButton(); rdb = (RadioButton)gvr.Cells[1].FindControl("rdbSelect"); if (rdb.Checked) { lblStudId = (Label)gvr.Cells[0].FindControl("lblStudId"); MyReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; MyReportViewer.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportsURI"].ToString()); // Report Server URL MyReportViewer.ServerReport.ReportPath = ConfigurationManager.AppSettings["ReportsFolder"].ToString() + "StudentIDReport"; // Report Name MyReportViewer.ShowParameterPrompts = false; MyReportViewer.ShowPrintButton = true; MyReportViewer.ShowToolBar = true; // Below code demonstrate the Parameter passing method. User only if you have parameters into the reports. Microsoft.Reporting.WebForms.ReportParameter[] reportParameterCollection = new Microsoft.Reporting.WebForms.ReportParameter[1]; reportParameterCollection[0] = new Microsoft.Reporting.WebForms.ReportParameter("StudId", lblStudId.Text); MyReportViewer.ServerReport.SetParameters(reportParameterCollection); MyReportViewer.ServerReport.Refresh(); break; } } }
protected void btnReport_Click(object sender, EventArgs e) { string Batch = string.Empty, Class = string.Empty, Section = string.Empty, Caste = string.Empty, Gender = string.Empty; Batch = ddlBatch.Items[ddlBatch.SelectedIndex].Value; Class = ddlClasses.Items[ddlClasses.SelectedIndex].Value; Section = ddlSections.Items[ddlSections.SelectedIndex].Value; Caste = ddlCaste.Items[ddlCaste.SelectedIndex].Value; Gender = ddlGender.Items[ddlGender.SelectedIndex].Value; MyReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; MyReportViewer.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportsURI"].ToString()); // Report Server URL MyReportViewer.ServerReport.ReportPath =ConfigurationManager.AppSettings["ReportsFolder"].ToString()+ "StudentDetails"; // Report Name MyReportViewer.ShowParameterPrompts = false; MyReportViewer.ShowPrintButton = true; MyReportViewer.ShowToolBar = true; MyReportViewer.SizeToReportContent = true; // Below code demonstrate the Parameter passing method. User only if you have parameters into the reports. Microsoft.Reporting.WebForms.ReportParameter[] reportParameterCollection = new Microsoft.Reporting.WebForms.ReportParameter[5]; reportParameterCollection[0] = new Microsoft.Reporting.WebForms.ReportParameter("Batch", Batch); reportParameterCollection[1] = new Microsoft.Reporting.WebForms.ReportParameter("Class", Class); reportParameterCollection[2] = new Microsoft.Reporting.WebForms.ReportParameter("section", Section); reportParameterCollection[3] = new Microsoft.Reporting.WebForms.ReportParameter("Caste", Caste); reportParameterCollection[4] = new Microsoft.Reporting.WebForms.ReportParameter("Gender", Gender); MyReportViewer.ServerReport.SetParameters(reportParameterCollection); MyReportViewer.ServerReport.Refresh(); }
protected void btnReport_Click(object sender, EventArgs e) { string DishName = string.Empty, MealType = string.Empty, FromDate = string.Empty, ToDate = string.Empty; DishName = ddlDishId.Items[ddlDishId.SelectedIndex].Value; MealType = ddlMealType.Items[ddlMealType.SelectedIndex].Value; if (txtFromDate.Text != "") FromDate =ChangeDateFormat(txtFromDate.Text); if (txtToDate.Text != "") ToDate = ChangeDateFormat(txtToDate.Text); MyReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; MyReportViewer.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportsURI"].ToString()); // Report Server URL MyReportViewer.ServerReport.ReportPath = ConfigurationManager.AppSettings["ReportsFolder"].ToString() + "MessDishConsumption"; // Report Name MyReportViewer.ShowParameterPrompts = false; MyReportViewer.ShowPrintButton = true; MyReportViewer.ShowToolBar = true; MyReportViewer.SizeToReportContent = true; // Below code demonstrate the Parameter passing method. User only if you have parameters into the reports. Microsoft.Reporting.WebForms.ReportParameter[] reportParameterCollection = new Microsoft.Reporting.WebForms.ReportParameter[4]; reportParameterCollection[0] = new Microsoft.Reporting.WebForms.ReportParameter("dishid", DishName); reportParameterCollection[1] = new Microsoft.Reporting.WebForms.ReportParameter("mealType", MealType); reportParameterCollection[2] = new Microsoft.Reporting.WebForms.ReportParameter("FromDate", FromDate); reportParameterCollection[3] = new Microsoft.Reporting.WebForms.ReportParameter("ToDate", ToDate); MyReportViewer.ServerReport.SetParameters(reportParameterCollection); MyReportViewer.ServerReport.Refresh(); }
protected void btnReport_Click(object sender, EventArgs e) { string Staff = string.Empty, Gender = string.Empty, Teach = string.Empty, AppMode = string.Empty, PostType = string.Empty,Cader=string.Empty; Staff = ddlStaffId.Items[ddlStaffId.SelectedIndex].Value; Gender = ddlGender.Items[ddlGender.SelectedIndex].Value; Teach = ddlTeachingandNonTeaching.Items[ddlTeachingandNonTeaching.SelectedIndex].Value; AppMode = ddlModeOfAppointment.Items[ddlModeOfAppointment.SelectedIndex].Value; PostType = ddlTypeOfPost.Items[ddlTypeOfPost.SelectedIndex].Value; Cader = ddlCader.Items[ddlCader.SelectedIndex].Value; StaffTrainingReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; StaffTrainingReportViewer.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportsURI"].ToString()); StaffTrainingReportViewer.ServerReport.ReportPath = ConfigurationManager.AppSettings["ReportsFolder"].ToString() + "StaffDetails"; StaffTrainingReportViewer.ShowParameterPrompts = false; StaffTrainingReportViewer.ShowPrintButton = true; StaffTrainingReportViewer.ShowToolBar = true; StaffTrainingReportViewer.SizeToReportContent = true; Microsoft.Reporting.WebForms.ReportParameter[] StaffTrainingCourseParam = new Microsoft.Reporting.WebForms.ReportParameter[6]; StaffTrainingCourseParam[0] = new Microsoft.Reporting.WebForms.ReportParameter("StaffId", Staff); StaffTrainingCourseParam[1] = new Microsoft.Reporting.WebForms.ReportParameter("Gender",Gender); StaffTrainingCourseParam[2] = new Microsoft.Reporting.WebForms.ReportParameter("TeachingandNonTeaching", Teach); StaffTrainingCourseParam[3] = new Microsoft.Reporting.WebForms.ReportParameter("ModeOfAppointment", AppMode); StaffTrainingCourseParam[4] = new Microsoft.Reporting.WebForms.ReportParameter("TypeOfPost", PostType); StaffTrainingCourseParam[5] = new Microsoft.Reporting.WebForms.ReportParameter("Cader", Cader); StaffTrainingReportViewer.ServerReport.SetParameters(StaffTrainingCourseParam); StaffTrainingReportViewer.ServerReport.Refresh(); }
protected void btnReport_Click(object sender, EventArgs e) { string FullName = string.Empty, IssueFromDate = string.Empty, IssueToDate = string.Empty, DueFromDate = string.Empty, DueToDate = string.Empty; FullName = ddlStaff.Items[ddlStaff.SelectedIndex].Value; if (txtIssueFromDate.Text != "") IssueFromDate = ChangeDateFormat(txtIssueFromDate.Text); if (txtIssueToDate.Text != "") IssueToDate = ChangeDateFormat(txtIssueToDate.Text); if (txtDueFromDate.Text != "") DueFromDate = ChangeDateFormat(txtDueFromDate.Text); if (txtDueToDate.Text != "") DueToDate = ChangeDateFormat(txtDueToDate.Text); MyReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; MyReportViewer.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportsURI"].ToString()); // Report Server URL MyReportViewer.ServerReport.ReportPath = ConfigurationManager.AppSettings["ReportsFolder"].ToString()+ "StaffBookIssue"; // Report Name MyReportViewer.ShowParameterPrompts = false; MyReportViewer.ShowPrintButton = true; MyReportViewer.ShowToolBar = true; MyReportViewer.SizeToReportContent = true; // Below code demonstrate the Parameter passing method. User only if you have parameters into the reports. Microsoft.Reporting.WebForms.ReportParameter[] reportParameterCollection = new Microsoft.Reporting.WebForms.ReportParameter[5]; reportParameterCollection[0] = new Microsoft.Reporting.WebForms.ReportParameter("Staff", FullName); reportParameterCollection[1] = new Microsoft.Reporting.WebForms.ReportParameter("IssueFromDate", IssueFromDate); reportParameterCollection[2] = new Microsoft.Reporting.WebForms.ReportParameter("IssueToDate", IssueToDate); reportParameterCollection[3] = new Microsoft.Reporting.WebForms.ReportParameter("DueFromDate", DueFromDate); reportParameterCollection[4] = new Microsoft.Reporting.WebForms.ReportParameter("DueToDate", DueToDate); MyReportViewer.ServerReport.SetParameters(reportParameterCollection); MyReportViewer.ServerReport.Refresh(); }
/// <summary> /// Get the collection of web form report parameters. /// </summary> /// <param name="reportBindingSource">The report binding source collection.</param> /// <returns>The report parameter collection</returns> public static Microsoft.Reporting.WebForms.ReportParameter[] WebFormsReportParameter(Nequeo.Model.DataSource.BindingSourceData[] reportBindingSource) { // Create a new generic report parameter List <Microsoft.Reporting.WebForms.ReportParameter> reportParameters = new List <Microsoft.Reporting.WebForms.ReportParameter>(); // For each parameter found. foreach (Nequeo.Model.DataSource.BindingSourceData item in reportBindingSource) { if (item.BindingSourceParameters != null && item.BindingSourceParameters.Count() > 0) { foreach (Nequeo.Model.DataSource.BindingSourceParameter reportParameter in item.BindingSourceParameters) { Microsoft.Reporting.WebForms.ReportParameter parameter = new Microsoft.Reporting.WebForms.ReportParameter(); parameter.Name = reportParameter.Name; parameter.Values.Add(reportParameter.Value.ToString()); parameter.Visible = true; reportParameters.Add(parameter); } } } // Return the report parameter collection. return(reportParameters.Count() > 0 ? reportParameters.ToArray() : null); }
protected void btnGetReport_Click(object sender, EventArgs e) { try { string Month = string.Empty; string Year = string.Empty; string ItemName = string.Empty; Month = ddlMonth.Items[ddlMonth.SelectedIndex].Value; Year = ddlYear.Items[ddlYear.SelectedIndex].Value; ItemName= ddlItemName.Items[ddlItemName.SelectedIndex].Value; MessPurchaseReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; MessPurchaseReportViewer.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportsURI"].ToString()); MessPurchaseReportViewer.ServerReport.ReportPath = ConfigurationManager.AppSettings["ReportsFolder"].ToString() + "StorePurchases"; MessPurchaseReportViewer.ShowParameterPrompts = false; MessPurchaseReportViewer.ShowPrintButton = true; MessPurchaseReportViewer.ShowToolBar = true; MessPurchaseReportViewer.SizeToReportContent = true; Microsoft.Reporting.WebForms.ReportParameter[] MessPurchaseParam = new Microsoft.Reporting.WebForms.ReportParameter[3]; MessPurchaseParam[0] = new Microsoft.Reporting.WebForms.ReportParameter("Month", Month); MessPurchaseParam[1] = new Microsoft.Reporting.WebForms.ReportParameter("Year", Year); MessPurchaseParam[2] = new Microsoft.Reporting.WebForms.ReportParameter("ItemName", ItemName); MessPurchaseReportViewer.ServerReport.SetParameters(MessPurchaseParam); MessPurchaseReportViewer.ServerReport.Refresh(); } catch (Exception) { throw; } }
protected void btnReport_Click(object sender, EventArgs e) { string Subject = string.Empty, Category = string.Empty, AcessionNo = string.Empty, Author = string.Empty, Year = string.Empty, Language = string.Empty; Subject = ddlSubject.Items[ddlSubject.SelectedIndex].Value; Category = ddlCategory.Items[ddlCategory.SelectedIndex].Value; AcessionNo = txtAcessionNo.Text; Author = txtAuthor.Text; Year = ddlLibYear.Items[ddlLibYear.SelectedIndex].Value; Language = ddlLanguage.Items[ddlLanguage.SelectedIndex].Value; MessPurchaseReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; MessPurchaseReportViewer.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportsURI"].ToString()); MessPurchaseReportViewer.ServerReport.ReportPath = ConfigurationManager.AppSettings["ReportsFolder"].ToString() + "BookDetails"; MessPurchaseReportViewer.ShowParameterPrompts = false; MessPurchaseReportViewer.ShowPrintButton = true; MessPurchaseReportViewer.ShowToolBar = true; MessPurchaseReportViewer.SizeToReportContent = true; Microsoft.Reporting.WebForms.ReportParameter[] MessPurchaseParam = new Microsoft.Reporting.WebForms.ReportParameter[6]; MessPurchaseParam[0] = new Microsoft.Reporting.WebForms.ReportParameter("Subject", Subject); MessPurchaseParam[1] = new Microsoft.Reporting.WebForms.ReportParameter("Category", Category); MessPurchaseParam[2] = new Microsoft.Reporting.WebForms.ReportParameter("AcessionNo", AcessionNo); MessPurchaseParam[3] = new Microsoft.Reporting.WebForms.ReportParameter("Author", Author); MessPurchaseParam[4] = new Microsoft.Reporting.WebForms.ReportParameter("YearofPub", Year); MessPurchaseParam[5] = new Microsoft.Reporting.WebForms.ReportParameter("Language", Language); MessPurchaseReportViewer.ServerReport.SetParameters(MessPurchaseParam); MessPurchaseReportViewer.ServerReport.Refresh(); }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { RPT_PayRegisterAnnualRowWise.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_PayRegisterAnnualRowWise.ServerReport; Microsoft.Reporting.WebForms.ReportParameter Organisation; Microsoft.Reporting.WebForms.ReportParameter BusinessGroup; Microsoft.Reporting.WebForms.ReportParameter Period; string sDomain = ConfigurationSettings.AppSettings["MyReportViewerDomain"]; string MyReportPath = System.Configuration.ConfigurationSettings.AppSettings["MyReportPath"]; WebClient wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); serverReport.ReportPath = MyReportPath + "PayRegisterAnnual"; if (Convert.ToString(Request.QueryString["ORG"]) != "") { Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Request.QueryString["ORG"])); } else { Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", "-1"); } if (Convert.ToString(Request.QueryString["BU"]) != "") { BusinessGroup = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", Convert.ToString(Request.QueryString["BU"])); } else { BusinessGroup = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", "-1"); } if (Convert.ToString(Request.QueryString["PRD"]) != "") { Period = new Microsoft.Reporting.WebForms.ReportParameter("Period", Convert.ToString(Request.QueryString["PRD"])); } else { Period = new Microsoft.Reporting.WebForms.ReportParameter("Period", "-1"); } //Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Session["ORG_ID"])); Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Organisation, BusinessGroup, Period }; serverReport.SetParameters(parameters); serverReport.Refresh(); RPT_PayRegisterAnnualRowWise.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "PayRegisterAnnualRowWiseReport", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { RPT_P9Report1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_P9Report1.ServerReport; Microsoft.Reporting.WebForms.ReportParameter BusinessGroup; Microsoft.Reporting.WebForms.ReportParameter Period; Microsoft.Reporting.WebForms.ReportParameter Organisation; Microsoft.Reporting.WebForms.ReportParameter Employee; //if (Convert.ToString(Request.QueryString["DEPT"]) != null) //{ // Department = new Microsoft.Reporting.WebForms.ReportParameter("Department", Convert.ToString(Request.QueryString["DEPT"])); //} //else //{ // Department = new Microsoft.Reporting.WebForms.ReportParameter("Department", "-1"); //} if (Convert.ToString(Request.QueryString["BU"]) != null) { BusinessGroup = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", Convert.ToString(Request.QueryString["BU"])); } else { BusinessGroup = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", "-1"); } if (Convert.ToString(Request.QueryString["PRD"]) != null) { Period = new Microsoft.Reporting.WebForms.ReportParameter("Period", Convert.ToString(Request.QueryString["PRD"])); } else { Period = new Microsoft.Reporting.WebForms.ReportParameter("Period", "-1"); } if (Convert.ToString(Request.QueryString["EMP"]) != null) { Employee = new Microsoft.Reporting.WebForms.ReportParameter("Employee", Convert.ToString(Request.QueryString["PRD"])); } else { Employee = new Microsoft.Reporting.WebForms.ReportParameter("Employee", "-1"); } Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Session["ORG_ID"])); Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Organisation, Period, BusinessGroup, Employee }; serverReport.SetParameters(parameters); serverReport.Refresh(); RPT_P9Report1.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Default3", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadReport() { Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[1]; string reportName = "RDMAAReport"; ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("Period", this.FinanceYear.Text.Trim()); //load report this.ReportViewer.LoadReport(reportName, ps); }
private void LoadReport() { Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[1]; string reportName = "ReportPL"; ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("Period", this.Period.SelectedDate); //load report this.ReportViewer.LoadReport(reportName, ps); }
protected void btnReport_Click(object sender, EventArgs e) { string Date1 = String.Empty; string Date2 = String.Empty; string Activitytype = String.Empty; string prize,Club; Date1 = ChangeDateFormat(txtFromDate.Text); Date2 = ChangeDateFormat(txtToDate.Text); Activitytype = (ddlactivtytype.SelectedValue); prize = ddlprize.SelectedItem.ToString(); Club = ddlClub.SelectedValue.ToString(); if (ddlactivtytype.SelectedValue == "1") { StudntActivityReport.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; StudntActivityReport.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportsURI"].ToString()); // Report Server URL StudntActivityReport.ServerReport.ReportPath = ConfigurationManager.AppSettings["ReportsFolder"].ToString() + "stdActive"; // Report Name StudntActivityReport.ShowParameterPrompts = false; StudntActivityReport.ShowPrintButton = true; StudntActivityReport.ShowToolBar = true; StudntActivityReport.SizeToReportContent = true; // Below code demonstrate the Parameter passing method. User only if you have parameters into the reports. Microsoft.Reporting.WebForms.ReportParameter[] reportParameterCollection = new Microsoft.Reporting.WebForms.ReportParameter[5]; reportParameterCollection[0] = new Microsoft.Reporting.WebForms.ReportParameter("Fromdate", Date1); reportParameterCollection[1] = new Microsoft.Reporting.WebForms.ReportParameter("Todate", Date2); reportParameterCollection[2] = new Microsoft.Reporting.WebForms.ReportParameter("Activitytype", Activitytype); reportParameterCollection[3] = new Microsoft.Reporting.WebForms.ReportParameter("Prize", prize); reportParameterCollection[4] = new Microsoft.Reporting.WebForms.ReportParameter("Club", Club); StudntActivityReport.ServerReport.SetParameters(reportParameterCollection); StudntActivityReport.ServerReport.Refresh(); } else if (ddlactivtytype.SelectedValue == "2") { StudntActivityReport.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; StudntActivityReport.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportsURI"].ToString()); // Report Server URL StudntActivityReport.ServerReport.ReportPath = ConfigurationManager.AppSettings["ReportsFolder"].ToString() + "StudentActivitybwd"; // Report Name StudntActivityReport.ShowParameterPrompts = false; StudntActivityReport.ShowPrintButton = true; StudntActivityReport.ShowToolBar = true; StudntActivityReport.SizeToReportContent = true; // Below code demonstrate the Parameter passing method. User only if you have parameters into the reports. Microsoft.Reporting.WebForms.ReportParameter[] reportParameterCollection = new Microsoft.Reporting.WebForms.ReportParameter[5]; reportParameterCollection[0] = new Microsoft.Reporting.WebForms.ReportParameter("Fromdate", Date1); reportParameterCollection[1] = new Microsoft.Reporting.WebForms.ReportParameter("Todate", Date2); reportParameterCollection[2] = new Microsoft.Reporting.WebForms.ReportParameter("Activitytype", Activitytype); reportParameterCollection[3] = new Microsoft.Reporting.WebForms.ReportParameter("Prize", prize); reportParameterCollection[4] = new Microsoft.Reporting.WebForms.ReportParameter("Club", Club); StudntActivityReport.ServerReport.SetParameters(reportParameterCollection); StudntActivityReport.ServerReport.Refresh(); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { RPT_NextToKin.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_NextToKin.ServerReport; Microsoft.Reporting.WebForms.ReportParameter BusinessGroup; Microsoft.Reporting.WebForms.ReportParameter Period; Microsoft.Reporting.WebForms.ReportParameter Organisation; Microsoft.Reporting.WebForms.ReportParameter Department; string sDomain = System.Configuration.ConfigurationSettings.AppSettings["MyReportViewerDomain"]; WebClient Wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); string MyReportPath = System.Configuration.ConfigurationSettings.AppSettings["MyReportPath"]; serverReport.ReportPath = MyReportPath + "NextToKinReport"; if (Convert.ToString(Request.QueryString["DEPT"]) != "") { Department = new Microsoft.Reporting.WebForms.ReportParameter("DEPARTMENT", Convert.ToString(Request.QueryString["DEPT"])); } else { Department = new Microsoft.Reporting.WebForms.ReportParameter("DEPARTMENT", "-1"); } if (Convert.ToString(Request.QueryString["BU"]) != "") { BusinessGroup = new Microsoft.Reporting.WebForms.ReportParameter("BUSINESSUNIT", Convert.ToString(Request.QueryString["BU"])); } else { BusinessGroup = new Microsoft.Reporting.WebForms.ReportParameter("BUSINESSUNIT", "-1"); } if (Convert.ToString(Request.QueryString["PRD"]) != "") { Period = new Microsoft.Reporting.WebForms.ReportParameter("PERIOD", Convert.ToString(Request.QueryString["PRD"])); } else { Period = new Microsoft.Reporting.WebForms.ReportParameter("PERIOD", "-1"); } Organisation = new Microsoft.Reporting.WebForms.ReportParameter("ORGANISATION", Convert.ToString(Session["ORG_ID"])); Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Organisation, Period, BusinessGroup, Department }; serverReport.SetParameters(parameters); serverReport.Refresh(); RPT_NextToKin.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "NextToKinReport", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadReport() { string reportName = string.Empty; Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[1]; reportName = "Report1"; ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("URL", "http://localhost:26798/WebSite/Reports/GetApprovalInfo.asmx"); //load report this.ReportViewer.LoadReport(reportName, ps); }
protected void Page_Load(object sender, EventArgs e) { // If Not IsPostBack Then // Me.ReportViewer1.ServerReport.ReportServerCredentials = New ReportServerCredentials("user", "pass", "domain") // Me.ReportViewer1.ServerReport.Refresh() //End If if (!IsPostBack) { string username = !string.IsNullOrEmpty(Map.Database.SsrsUsername) ? Map.Database.SsrsUsername : Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["ssrsUsername"]); string password = !string.IsNullOrEmpty(Map.Database.SsrsPassword) ? Map.Database.SsrsPassword.Decrypt(Map.Database) : Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["ssrsPassword"]); string domain = !string.IsNullOrEmpty(Map.Database.SsrsDomain) ? Map.Database.SsrsDomain : Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["ssrsDomain"]); string reportServerUrl = !string.IsNullOrEmpty(Map.Database.SsrsReportServerUrl) && Map.Database.SsrsReportServerUrl.Split('|').Length == 3 ? Map.Database.SsrsReportServerUrl.Split('|')[2] : Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["reportServerUrl"]); string reportPath = !string.IsNullOrEmpty(Map.Database.SsrsPath) ? Map.Database.SsrsPath : Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["reportPath"]); string reportName = Request.QueryString["ReportName"]; string reportDisplayName = Request.QueryString["ReportDisplayName"]; //ReportViewer1.ServerReport.ReportServerCredentials = new ReportServerCredentials("itay", "dio2008", "devitoutsrv1"); ReportViewer1.ServerReport.ReportServerUrl = new Uri(reportServerUrl); ReportViewer1.ServerReport.ReportPath = reportPath + reportName; ReportViewer1.ServerReport.DisplayName = reportDisplayName; bool newWindow = !string.IsNullOrEmpty(this.Request.QueryString["NewWindow"]); if (newWindow) { ReportViewer1.SizeToReportContent = false; ReportViewer1.Height = Unit.Percentage(100); ReportViewer1.ZoomMode = Microsoft.Reporting.WebForms.ZoomMode.FullPage; } ReportServerCredentials reportServerCredentials = null; if (string.IsNullOrEmpty(username)) { reportServerCredentials = new ReportServerCredentials(); } else { reportServerCredentials = new ReportServerCredentials(username, password, domain); } ReportViewer1.ServerReport.ReportServerCredentials = reportServerCredentials; //Add user id and user role parameters //Add by miri h try { Microsoft.Reporting.WebForms.ReportParameter[] Param = new Microsoft.Reporting.WebForms.ReportParameter[2]; Param[0] = new Microsoft.Reporting.WebForms.ReportParameter("UserId", Map.Database.GetUserID()); Param[1] = new Microsoft.Reporting.WebForms.ReportParameter("UserRole", Map.Database.GetUserRole()); ReportViewer1.ServerReport.SetParameters(Param); } catch (Exception ex) { Map.Logger.Log("Report", "SetParameters", "Page_Load", ex, 1, ""); } ReportViewer1.ServerReport.Refresh(); } }
private void LoadReport(string FormID) { string reportName = string.Empty; Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[1]; reportName = "BatchSalesPromotionPrintReport"; ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("FormIDS", FormID); //load report this.ReportViewer1.LoadReport(reportName, ps); }
private void LoadReport() { string reportName = string.Empty; Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[1]; reportName = "ReportTEBudget"; ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("FinanceYear", this.FinanceYear.Text.Trim()); //load report this.ReportViewer.LoadReport(reportName, ps); }
private void LoadReport() { Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[2]; string reportName = "ReportMAAging"; ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("BeginDate", this.UCDateInputBeginDate.SelectedDate); ps[1] = new Microsoft.Reporting.WebForms.ReportParameter("EndDate", this.UCDateInputEndDate.SelectedDate); //load report this.ReportViewer.LoadReport(reportName, ps); }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { RPT_Form6A.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_Form6A.ServerReport; Microsoft.Reporting.WebForms.ReportParameter Organisation; Microsoft.Reporting.WebForms.ReportParameter FromDate; Microsoft.Reporting.WebForms.ReportParameter ToDate; string sDomain = ConfigurationSettings.AppSettings["MyReportViewerDomain"]; string MyReportPath = System.Configuration.ConfigurationSettings.AppSettings["MyReportPath"]; WebClient wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); serverReport.ReportPath = MyReportPath + "Form6A"; if (Convert.ToString(Request.QueryString["ORG_ID"]) != "") { Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Request.QueryString["ORG_ID"])); } else { Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", "-1"); } if (Convert.ToString(Request.QueryString["PRD"]) != "") { FromDate = new Microsoft.Reporting.WebForms.ReportParameter("FromDate", Convert.ToString(Request.QueryString["PRD"])); } else { FromDate = new Microsoft.Reporting.WebForms.ReportParameter("FromDate", "-1"); } if (Convert.ToString(Request.QueryString["EDATE"]) != "") { ToDate = new Microsoft.Reporting.WebForms.ReportParameter("ToDate", Convert.ToString(Request.QueryString["EDATE"])); } else { ToDate = new Microsoft.Reporting.WebForms.ReportParameter("ToDate", "-1"); } Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Organisation, FromDate, ToDate }; serverReport.SetParameters(parameters); serverReport.Refresh(); RPT_Form6A.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Form6AReport", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void LoadReport() { try { rwDivWiseEmp.VisibleOnPageLoad = true; RPT_DivisionalwiseEmployeereport.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_DivisionalwiseEmployeereport.ServerReport; Microsoft.Reporting.WebForms.ReportParameter Organisation; Microsoft.Reporting.WebForms.ReportParameter Businessunit; Microsoft.Reporting.WebForms.ReportParameter Department; string sDomain = ConfigurationSettings.AppSettings["MyReportViewerDomain"]; WebClient wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); string MyReportPath = System.Configuration.ConfigurationSettings.AppSettings["MyReportPath"]; serverReport.ReportPath = MyReportPath + "DivisionalwiseEmploye"; if (Convert.ToString(Request.QueryString["ORG_ID"]) != "") { Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Session["ORG_ID"])); } else { Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", "-1"); } if (Convert.ToString(Request.QueryString["BU"]) != "") { Businessunit = new Microsoft.Reporting.WebForms.ReportParameter("Businessunit", Convert.ToString(rcmb_BusinessUnit.SelectedValue)); } else { Businessunit = new Microsoft.Reporting.WebForms.ReportParameter("Businessunit", "-1"); } if (Convert.ToString(Request.QueryString["Dept"]) != "") { Department = new Microsoft.Reporting.WebForms.ReportParameter("Department", Convert.ToString(rcmb_Department.SelectedValue)); } else { Department = new Microsoft.Reporting.WebForms.ReportParameter("Department", "-1"); } Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Organisation, Businessunit, Department }; serverReport.SetParameters(parameters); serverReport.Refresh(); RPT_DivisionalwiseEmployeereport.Visible = true; } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "DivisionalwiseEmployee", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { RPT_ResourcesStatus.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_ResourcesStatus.ServerReport; Microsoft.Reporting.WebForms.ReportParameter ORG; Microsoft.Reporting.WebForms.ReportParameter BU; Microsoft.Reporting.WebForms.ReportParameter RMANAGER; //Microsoft.Reporting.WebForms.ReportParameter EMP_LOGIN_ID; string sDomain = ConfigurationSettings.AppSettings["MyReportViewerDomain"]; WebClient wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); string MyReportPath = System.Configuration.ConfigurationSettings.AppSettings["MyReportPath"]; serverReport.ReportPath = MyReportPath + "Resources Status"; if (Convert.ToString(Request.QueryString["BU"]) != "") { BU = new Microsoft.Reporting.WebForms.ReportParameter("BU", Convert.ToString(Request.QueryString["BU"])); } else { BU = new Microsoft.Reporting.WebForms.ReportParameter("BU", "-1"); } if (Convert.ToString(Request.QueryString["Rep_Emp"]) != "") { RMANAGER = new Microsoft.Reporting.WebForms.ReportParameter("RMANAGER", Convert.ToString(Request.QueryString["Rep_Emp"])); } else { RMANAGER = new Microsoft.Reporting.WebForms.ReportParameter("RMANAGER", "-1"); } //EMP_LOGIN_ID = new Microsoft.Reporting.WebForms.ReportParameter("EMP_LOGIN_ID", Convert.ToString(Session["USER_ID"])); ORG = new Microsoft.Reporting.WebForms.ReportParameter("ORG", Convert.ToString(Session["ORG_ID"])); Microsoft.Reporting.WebForms.ReportParameter[] parameters = { ORG, BU, RMANAGER }; serverReport.SetParameters(parameters); serverReport.Refresh(); RPT_ResourcesStatus.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "ResourcesStatusReport", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
public void SetParameters(ReportParameter[] parameters) { Microsoft.Reporting.WebForms.ReportParameter[] para = new Microsoft.Reporting.WebForms.ReportParameter[parameters.Length]; for (int i = 0; i < parameters.Length; ++i) { para[i] = new Microsoft.Reporting.WebForms.ReportParameter(parameters[i].Name, parameters[i].Values, parameters[i].Visible); } this.m_Viewer.LocalReport.SetParameters(para); }
private void LoadReport() { string reportName = string.Empty; Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[2]; reportName = "SalesReimburseRateReport"; ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("OUID", this.UCOU.OUId.ToString()); ps[1] = new Microsoft.Reporting.WebForms.ReportParameter("EndDate", this.UCDateInputEndDate.SelectedDate); //load report this.ReportViewer.LoadReport(reportName, ps); }
private void LoadReport(string FormID) { string reportName = string.Empty; Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[1]; reportName = "BatchSalesPromotionPrintReport"; ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("FormIDS", FormID); //load report this.ReportViewer1.LoadReport(reportName, ps); }
private void loadReport() { string reportName = "SalesBudgetByPosition"; AuthorizationDS.PositionRow position = (AuthorizationDS.PositionRow)this.Session["Position"]; Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[2]; ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("PositionID", position.PositionId.ToString()); ps[1] = new Microsoft.Reporting.WebForms.ReportParameter("Year", DateTime.Now.Year.ToString()); //load report this.ReportViewer.LoadReport(reportName, ps); }
private void loadReport() { string reportName = "SalesBudgetByPosition"; AuthorizationDS.PositionRow position = (AuthorizationDS.PositionRow) this.Session["Position"]; Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[2]; ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("PositionID", position.PositionId.ToString()); ps[1] = new Microsoft.Reporting.WebForms.ReportParameter("Year", DateTime.Now.Year.ToString()); //load report this.ReportViewer.LoadReport(reportName, ps); }
private void LoadReport() { string reportName = string.Empty; Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[2]; reportName = "SalesReimburseRateReport"; AuthorizationDS.PositionRow position = (AuthorizationDS.PositionRow)this.Session["Position"]; ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("OUID", position.OrganizationUnitId.ToString()); ps[1] = new Microsoft.Reporting.WebForms.ReportParameter("EndDate", this.UCDateInputEndDate.SelectedDate); //load report this.ReportViewer.LoadReport(reportName, ps); }
private void LoadReport() { string reportName = string.Empty; Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[2]; reportName = "SalesReimburseRateReport"; ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("OUID", this.UCOU.OUId.ToString()); ps[1] = new Microsoft.Reporting.WebForms.ReportParameter("EndDate", this.UCDateInputEndDate.SelectedDate); //load report this.ReportViewer.LoadReport(reportName, ps); }
private void LoadReport() { string reportName = string.Empty; Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[3]; reportName = "VendorReport"; ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("CompanyCode", this.CompanyCode.Text.Trim()); ps[1] = new Microsoft.Reporting.WebForms.ReportParameter("BeginDate", this.UCDateInputBeginDate.SelectedDate); ps[2] = new Microsoft.Reporting.WebForms.ReportParameter("EndDate", this.UCDateInputEndDate.SelectedDate); //load report this.ReportViewer.LoadReport(reportName, ps); }
private void LoadReport() { Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[2]; string reportName = "ReportRegion_ByExpenseType"; ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("Period", this.FinanceYear.Text.Trim()); //�û���Ϣ AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"]; ps[1] = new Microsoft.Reporting.WebForms.ReportParameter("USERID", stuffUser.StuffUserId+""); //load report this.ReportViewer.LoadReport(reportName, ps); }
protected void btnSearch_Click(object sender, EventArgs e) { if (!checkSearchConditionValid()) { return; } else { string reportName = string.Empty; Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[1]; ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("QueryExpression",getSearchCondition()); reportName = "SalesReimburseDelivery"; this.ReportViewer.LoadReport(reportName, ps); } }
private void LoadReport() { string reportName = string.Empty; Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[2]; reportName = "SalesTotalFee"; AuthorizationDS.PositionRow position = (AuthorizationDS.PositionRow) this.Session["Position"]; ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("OUID", position.OrganizationUnitId.ToString()); ps[1] = new Microsoft.Reporting.WebForms.ReportParameter("EndDate", this.UCDateInputEndDate.SelectedDate); //load report this.ReportViewer.LoadReport(reportName, ps); }
private void LoadReport() { string reportName = string.Empty; Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[4]; reportName = "FormPVDelayReport"; ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("BeginDate", this.UCDateInputBeginDate.SelectedDate); ps[1] = new Microsoft.Reporting.WebForms.ReportParameter("EndDate", this.UCDateInputEndDate.SelectedDate); ps[2] = new Microsoft.Reporting.WebForms.ReportParameter("OUID", this.UCOU.OUId.ToString()); ps[3] = new Microsoft.Reporting.WebForms.ReportParameter("StaffName", this.userId.Text.Trim()); //load report this.ReportViewer.LoadReport(reportName, ps); }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { RPT_terminateEmployee.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_terminateEmployee.ServerReport; Microsoft.Reporting.WebForms.ReportParameter Employee; Microsoft.Reporting.WebForms.ReportParameter Grievance; string sDomain = System.Configuration.ConfigurationSettings.AppSettings["MyReportViewerDomain"]; WebClient Wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); string MyReportPath = System.Configuration.ConfigurationSettings.AppSettings["MyReportPath"]; if (Convert.ToString(Request.QueryString["empid"]) != "") { Employee = new Microsoft.Reporting.WebForms.ReportParameter("Employee", Convert.ToString(Request.QueryString["empid"])); } else { Employee = new Microsoft.Reporting.WebForms.ReportParameter("Employee", "-1"); } Grievance = new Microsoft.Reporting.WebForms.ReportParameter("Grievance", Convert.ToString(Request.QueryString["grevid"])); //OG=' + org + '&BU=' + buid + '&DER=' + derict+'&DEP='+depart+'&FMDATE='+frmdate+'&TDAT='+Tdate, "RadWindow1"); if (Convert.ToString(Request.QueryString["type"]).ToUpper() == "TERMINATE") { serverReport.ReportPath = MyReportPath + "Termination"; Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Employee }; serverReport.SetParameters(parameters); } else { serverReport.ReportPath = MyReportPath + "Suspension"; Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Employee, Grievance }; serverReport.SetParameters(parameters); } serverReport.Refresh(); RPT_terminateEmployee.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_lettermail", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadReport() { string reportName = string.Empty; Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[5]; reportName = "FormPVReport"; ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("BeginDate", this.UCDateInputBeginDate.SelectedDate); ps[1] = new Microsoft.Reporting.WebForms.ReportParameter("EndDate", this.UCDateInputEndDate.SelectedDate); ps[2] = new Microsoft.Reporting.WebForms.ReportParameter("OrganizationUnitID", this.UCOU.OUId.ToString()); ps[3] = new Microsoft.Reporting.WebForms.ReportParameter("UserID", this.userId.Text.Trim()); ps[4] = new Microsoft.Reporting.WebForms.ReportParameter("FromType", "3"); //load report this.ReportViewer.LoadReport(reportName, ps); }
protected void btnReport_Click(object sender, EventArgs e) { string Batch = string.Empty, Class = string.Empty, Section = string.Empty, Subject = string.Empty, ExamType = string.Empty,ScholasticArea=string.Empty; Batch = ddlBatch.Items[ddlBatch.SelectedIndex].Value; Class = ddlClass.Items[ddlClass.SelectedIndex].Value; //Section = ddlSection.Items[ddlSection.SelectedIndex].Value; Subject = ddlSubject.Items[ddlSubject.SelectedIndex].Value; ExamType = ddlExamType.Items[ddlExamType.SelectedIndex].Value; ScholasticArea = ddlScholastisarea.Items[ddlScholastisarea.SelectedIndex].Value; if (rbtnGraphical.Checked) { if (ddlChartType.SelectedIndex == 1) { MyReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; MyReportViewer.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportsURI"].ToString()); // Report Server URL MyReportViewer.ServerReport.ReportPath = ConfigurationManager.AppSettings["ReportsFolder"].ToString() + "GraphicalCCEReportScholasticWiseStudentsPercentageCount"; // Report Name MyReportViewer.ShowParameterPrompts = false; MyReportViewer.ShowPrintButton = true; MyReportViewer.ShowToolBar = true; MyReportViewer.SizeToReportContent = true; // Below code demonstrate the Parameter passing method. User only if you have parameters into the reports. Microsoft.Reporting.WebForms.ReportParameter[] reportParameterCollection = new Microsoft.Reporting.WebForms.ReportParameter[5]; reportParameterCollection[0] = new Microsoft.Reporting.WebForms.ReportParameter("Batch", Batch); reportParameterCollection[1] = new Microsoft.Reporting.WebForms.ReportParameter("Classid", Class); reportParameterCollection[2] = new Microsoft.Reporting.WebForms.ReportParameter("ExamID", ExamType); reportParameterCollection[3] = new Microsoft.Reporting.WebForms.ReportParameter("SubjectID", Subject); reportParameterCollection[4] = new Microsoft.Reporting.WebForms.ReportParameter("ScholasticID", ScholasticArea); MyReportViewer.ServerReport.SetParameters(reportParameterCollection); MyReportViewer.ServerReport.Refresh(); } } if (rbtnTabularReport.Checked) { MyReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; MyReportViewer.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportsURI"].ToString()); // Report Server URL MyReportViewer.ServerReport.ReportPath = ConfigurationManager.AppSettings["ReportsFolder"].ToString() + "CCEReportScholasticWiseStudentsPercentageCount"; // Report Name MyReportViewer.ShowParameterPrompts = false; MyReportViewer.ShowPrintButton = true; MyReportViewer.ShowToolBar = true; MyReportViewer.SizeToReportContent = true; // Below code demonstrate the Parameter passing method. User only if you have parameters into the reports. Microsoft.Reporting.WebForms.ReportParameter[] reportParameterCollection = new Microsoft.Reporting.WebForms.ReportParameter[5]; reportParameterCollection[0] = new Microsoft.Reporting.WebForms.ReportParameter("Batch", Batch); reportParameterCollection[1] = new Microsoft.Reporting.WebForms.ReportParameter("Classid", Class); reportParameterCollection[2] = new Microsoft.Reporting.WebForms.ReportParameter("ExamID", ExamType); reportParameterCollection[3] = new Microsoft.Reporting.WebForms.ReportParameter("SubjectID", Subject); reportParameterCollection[4] = new Microsoft.Reporting.WebForms.ReportParameter("ScholasticID", ScholasticArea); MyReportViewer.ServerReport.SetParameters(reportParameterCollection); MyReportViewer.ServerReport.Refresh(); } }
protected void btnSearch_Click(object sender, EventArgs e) { if (!checkSearchConditionValid()) { return; } else { Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[3]; string reportName = "ReportDetailMarketingApply"; ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("queryExpression", getSearchCondition()); ps[1] = new Microsoft.Reporting.WebForms.ReportParameter("StuffUserID", ((AuthorizationDS.StuffUserRow)Session["StuffUser"]).StuffUserId.ToString()); ps[2] = new Microsoft.Reporting.WebForms.ReportParameter("PositionID", ((AuthorizationDS.PositionRow)Session["Position"]).PositionId.ToString()); //load report this.ReportViewer.LoadReport(reportName, ps); } }
protected void btnSearch_Click(object sender, EventArgs e) { if (!checkSearchConditionValid()) { return; } else { string reportName = string.Empty; Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[1]; ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("QueryExpression", getSearchCondition()); reportName = "SalesReimburseDelivery"; this.ReportViewer.LoadReport(reportName, ps); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Microsoft.Reporting.WebForms.ReportParameter[] i_cls_rParam = new Microsoft.Reporting.WebForms.ReportParameter[1]; i_cls_rParam[0] = new Microsoft.Reporting.WebForms.ReportParameter("generatedID", Request.QueryString["s_str_generatedID"]); string i_str_reportName = "ReportAllUser"; Report.ServerReport.ReportServerUrl = new Uri(System.Configuration.ConfigurationManager.AppSettings["ReportServerUrl"].ToString()); Report.ServerReport.ReportPath = System.Configuration.ConfigurationManager.AppSettings["ReportPath"].ToString() + i_str_reportName; Report.ServerReport.SetParameters(i_cls_rParam); Report.ServerReport.Refresh(); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { RPT_EmpLoans.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_EmpLoans.ServerReport; string sDomain = System.Configuration.ConfigurationSettings.AppSettings["MyReportViewerDomain"]; WebClient Wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); serverReport.ReportPath = "/SmartHR/" + "EmpLoansReport"; Microsoft.Reporting.WebForms.ReportParameter BusinessGroup; Microsoft.Reporting.WebForms.ReportParameter Employee; Microsoft.Reporting.WebForms.ReportParameter Organisation; if (Convert.ToString(Request.QueryString["BU"]) != "") { BusinessGroup = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", Convert.ToString(Request.QueryString["BU"])); } else { BusinessGroup = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", "-1"); } if (Convert.ToString(Request.QueryString["EMP"]) != "") { Employee = new Microsoft.Reporting.WebForms.ReportParameter("Employee", Convert.ToString(Request.QueryString["EMP"])); } else { Employee = new Microsoft.Reporting.WebForms.ReportParameter("Employee", "-1"); } Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Session["ORG_ID"])); Microsoft.Reporting.WebForms.ReportParameter[] parameters = { BusinessGroup, Employee, Organisation }; serverReport.SetParameters(parameters); serverReport.Refresh(); RPT_EmpLoans.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "EmpLoansReport", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); return; } }
protected void btnGetReport_Click(object sender, EventArgs e) { string DishName=string.Empty, Month = String.Empty, Year = String.Empty; DishName = ddlDishId.Items[ddlDishId.SelectedIndex].Value; Month = ddlMonth.Items[ddlMonth.SelectedIndex].Value; Year = ddlYear.Items[ddlYear.SelectedIndex].Value; if (rbtnGraphical.Checked) { if (ddlChartType.SelectedIndex == 1) { MonthlyMessItemCalculation.Visible = true; MonthlyMessItemCalculation.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; MonthlyMessItemCalculation.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportsURI"].ToString()); MonthlyMessItemCalculation.ServerReport.ReportPath = ConfigurationManager.AppSettings["ReportsFolder"].ToString() + "BarChartMonthlyMessItemCalculation"; MonthlyMessItemCalculation.ShowParameterPrompts = false; MonthlyMessItemCalculation.ShowPrintButton = true; MonthlyMessItemCalculation.ShowToolBar = true; MonthlyMessItemCalculation.SizeToReportContent = true; // Below code demonstrate the Parameter passing method. User only if you have parameters into the reports. Microsoft.Reporting.WebForms.ReportParameter[] reportParameterCollection = new Microsoft.Reporting.WebForms.ReportParameter[3]; reportParameterCollection[0] = new Microsoft.Reporting.WebForms.ReportParameter("Item", DishName); reportParameterCollection[1] = new Microsoft.Reporting.WebForms.ReportParameter("Month", Month); reportParameterCollection[2] = new Microsoft.Reporting.WebForms.ReportParameter("Year", Year); MonthlyMessItemCalculation.ServerReport.SetParameters(reportParameterCollection); MonthlyMessItemCalculation.ServerReport.Refresh(); } } if (rbtnTabularReport.Checked) { MonthlyMessItemCalculation.Visible = true; MonthlyMessItemCalculation.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; MonthlyMessItemCalculation.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportsURI"].ToString()); MonthlyMessItemCalculation.ServerReport.ReportPath = ConfigurationManager.AppSettings["ReportsFolder"].ToString() + "MonthlyMessItemCalculation"; MonthlyMessItemCalculation.ShowParameterPrompts = false; MonthlyMessItemCalculation.ShowPrintButton = true; MonthlyMessItemCalculation.ShowToolBar = true; MonthlyMessItemCalculation.SizeToReportContent = true; // Below code demonstrate the Parameter passing method. User only if you have parameters into the reports. Microsoft.Reporting.WebForms.ReportParameter[] reportParameterCollection = new Microsoft.Reporting.WebForms.ReportParameter[3]; reportParameterCollection[0] = new Microsoft.Reporting.WebForms.ReportParameter("Item", DishName); reportParameterCollection[1] = new Microsoft.Reporting.WebForms.ReportParameter("Month", Month); reportParameterCollection[2] = new Microsoft.Reporting.WebForms.ReportParameter("Year", Year); MonthlyMessItemCalculation.ServerReport.SetParameters(reportParameterCollection); MonthlyMessItemCalculation.ServerReport.Refresh(); } }
private void LoadReport() { string reportName = string.Empty; Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[2]; reportName = "ReportTExpenseSummary"; string ouid = "0"; if (this.UCOU.OUId == null) { ouid = "0"; } else { ouid = this.UCOU.OUId.ToString(); } ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("OUID", ouid); ps[1] = new Microsoft.Reporting.WebForms.ReportParameter("Period", this.UCDateInputBeginDate.SelectedDate); //load report this.ReportViewer.LoadReport(reportName, ps); }
private void SetReportParameters(int iReportID, DataSet dt) { ReportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("DataSet1", dt.Tables[0])); // Parameters Section if (GlobalConstants.COMPANY_REPORT == iReportID) { string imagePath = new Uri(Server.MapPath(string.Format("~/Upload/Companies/3.PNG"))).AbsoluteUri; Microsoft.Reporting.WebForms.ReportParameter parameter = new Microsoft.Reporting.WebForms.ReportParameter("ImagePath", imagePath); ReportViewer1.LocalReport.SetParameters(parameter); } if (GlobalConstants.STUDENTFEE_REPORT == iReportID) { string imagePath = new Uri(Server.MapPath(string.Format("~/Upload/Companies/3.PNG"))).AbsoluteUri; Microsoft.Reporting.WebForms.ReportParameter parameter1 = new Microsoft.Reporting.WebForms.ReportParameter("ImagePath", imagePath); ReportViewer1.LocalReport.SetParameters(parameter1); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { RPT_EmployeePensionComputationsReport.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_EmployeePensionComputationsReport.ServerReport; Microsoft.Reporting.WebForms.ReportParameter Employee; Microsoft.Reporting.WebForms.ReportParameter Organisation; string sDomain = ConfigurationSettings.AppSettings["MyReportViewerDomain"]; WebClient wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); string MyReportPath = System.Configuration.ConfigurationSettings.AppSettings["MyReportPath"]; serverReport.ReportPath = MyReportPath + "Pension and Life Benefits Report"; if (Convert.ToString(Request.QueryString["EMP_ID"]) != "") { Employee = new Microsoft.Reporting.WebForms.ReportParameter("Employee", Convert.ToString(Request.QueryString["EMP_ID"])); } else { Employee = new Microsoft.Reporting.WebForms.ReportParameter("Employee", "-1"); } Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Session["ORG_ID"])); Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Employee }; serverReport.SetParameters(parameters); serverReport.Refresh(); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frmEmployeePensionComputationsReport", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { string strFJCID = (string)Session["FJCID"]; string strReportServerURL = ConfigurationManager.AppSettings["ReportServerURL"]; MyReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; MyReportViewer.ServerReport.ReportServerUrl = new Uri(strReportServerURL); // Report Server URL MyReportViewer.ServerReport.ReportPath = "/CIPMS_Reports/rpt_CamperApplicationDetails"; // Report Name MyReportViewer.ShowParameterPrompts = false; MyReportViewer.ShowDocumentMapButton = true; MyReportViewer.ShowPrintButton = true; // Pass FJCID parameter to report Microsoft.Reporting.WebForms.ReportParameter[] reportParameterCollection = new Microsoft.Reporting.WebForms.ReportParameter[1]; reportParameterCollection[0] = new Microsoft.Reporting.WebForms.ReportParameter(); reportParameterCollection[0].Name = "FJCID"; reportParameterCollection[0].Values.Add(strFJCID); MyReportViewer.ServerReport.SetParameters(reportParameterCollection); MyReportViewer.ServerReport.Refresh(); }
private void SetReportParameters(int iReportID, DataSet dt) { // Parameters Section if (GlobalConstants.StudentFEEBILL_Report == iReportID) { ReportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("StudentFeeBill", dt.Tables[0])); ReportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("FeeBillPaymentTerms", dt.Tables[1])); string imagePath = new Uri(Server.MapPath(string.Format("~/Upload/Companies/3.PNG"))).AbsoluteUri; Microsoft.Reporting.WebForms.ReportParameter parameter1 = new Microsoft.Reporting.WebForms.ReportParameter("ImagePath", imagePath); ReportViewer1.LocalReport.SetParameters(parameter1); } if (GlobalConstants.VoucherMaster_Report == iReportID || GlobalConstants.INQUERY_LIST_REPORT == iReportID || GlobalConstants.IssuedChallan_Report == iReportID || GlobalConstants.FeeReceipt_Report == iReportID || GlobalConstants.ChartOfAccount_Report == iReportID || GlobalConstants.printVoucher_Report == iReportID || GlobalConstants.General_Journal_Report == iReportID) { ReportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("DataSet1", dt.Tables[0])); } if (GlobalConstants.ChartOfAccount_Report == iReportID) { Microsoft.Reporting.WebForms.ReportParameter parameter1 = new Microsoft.Reporting.WebForms.ReportParameter("isBranch", BranchID > 0 ? "1" : "0"); ReportViewer1.LocalReport.SetParameters(parameter1); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if ((Request.Params["value"] != null)) { string nombrereporte = Request.Params["value"]; string titulo = Request.Params["titulo"]; this.lbltitulo.Text = titulo.Trim(); this.ReportViewer1.ServerReport.ReportPath = "/DELIVERY/" + nombrereporte.Trim(); //Dim cr As Microsoft.Reporting.WebForms.IReportServerCredentials //Me.ReportViewer1.ServerReport.ReportServerCredentials //Dim parametro As New Microsoft.Reporting.WebForms.ReportParameter("Empresa", Profile.Empresa) string IdEmpresa; if (Session["IdEmpresa"] != null) { IdEmpresa = Session["IdEmpresa"].ToString(); } else { IdEmpresa = "1"; } Microsoft.Reporting.WebForms.ReportParameter[] pa = new Microsoft.Reporting.WebForms.ReportParameter[1]; pa[0] = new Microsoft.Reporting.WebForms.ReportParameter("Empresa", IdEmpresa); this.ReportViewer1.ServerReport.SetParameters(pa); //Me.SimpleReportViewer.ServerReport.ReportServerUrl = "" } } }
private void LoadReport() { string reportName = string.Empty; Microsoft.Reporting.WebForms.ReportParameter[] ps = new Microsoft.Reporting.WebForms.ReportParameter[3]; if (Request["ExportType"] != null && Request["ExportType"] == "Good") { reportName = "SalesApply_Export(Good)"; } else { reportName = "SalesApply_Export(Total)"; } int stuffID = ((AuthorizationDS.StuffUserRow)Session["StuffUser"]).StuffUserId; int positionID = ((AuthorizationDS.PositionRow)Session["Position"]).PositionId; ps[0] = new Microsoft.Reporting.WebForms.ReportParameter("StuffUserID", stuffID.ToString()); ps[1] = new Microsoft.Reporting.WebForms.ReportParameter("PositionID", positionID.ToString()); ps[2] = new Microsoft.Reporting.WebForms.ReportParameter("QueryExpression", Session["QueryExpression"].ToString()); //load report this.ReportViewer.LoadReport(reportName, ps); }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { rptStr = Convert.ToString(Request.QueryString["rptStr"]); RPT_Report2.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_Report2.ServerReport; Microsoft.Reporting.WebForms.ReportParameter Organisation; Microsoft.Reporting.WebForms.ReportParameter BusinessUnit; Microsoft.Reporting.WebForms.ReportParameter Businessunit; Microsoft.Reporting.WebForms.ReportParameter Period; Microsoft.Reporting.WebForms.ReportParameter PeriodDetails; string sDomain = ConfigurationSettings.AppSettings["MyReportViewerDomain"]; WebClient wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); string MyReportPath = System.Configuration.ConfigurationSettings.AppSettings["MyReportPath"]; if (rptStr == "EBG") { serverReport.ReportPath = MyReportPath + "EmployeeBasicandgrosssalaryvariation"; } if (rptStr == "PD") { serverReport.ReportPath = MyReportPath + "paymentandDeduction"; } if (rptStr == "EMT") { serverReport.ReportPath = MyReportPath + "Employeemonthlytransaction"; } // serverReport.ReportPath = MyReportPath + "PayRegister"; if (Convert.ToString(Request.QueryString["ORG_ID"]) != "") { Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Request.QueryString["ORG_ID"])); } else { Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", "-1"); } if (Convert.ToString(Request.QueryString["BU"]) != "") { BusinessUnit = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", Convert.ToString(Request.QueryString["BU"])); Businessunit = new Microsoft.Reporting.WebForms.ReportParameter("Businessunit", Convert.ToString(Request.QueryString["BU"])); } else { BusinessUnit = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", "-1"); Businessunit = new Microsoft.Reporting.WebForms.ReportParameter("Businessunit", "-1"); } if (Convert.ToString(Request.QueryString["PRD"]) != "") { Period = new Microsoft.Reporting.WebForms.ReportParameter("Period", Convert.ToString(Request.QueryString["PRD"])); } else { Period = new Microsoft.Reporting.WebForms.ReportParameter("Period", "-1"); } if (Convert.ToString(Request.QueryString["prdDtl"]) != "") { PeriodDetails = new Microsoft.Reporting.WebForms.ReportParameter("PeriodDetails", Convert.ToString(Request.QueryString["prdDtl"])); } else { PeriodDetails = new Microsoft.Reporting.WebForms.ReportParameter("PeriodDetails", "-1"); } if (rptStr == "EBG") { Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Organisation, BusinessUnit, Period, PeriodDetails }; serverReport.SetParameters(parameters); } if (rptStr == "PD" || rptStr == "EMT") { Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Organisation, Businessunit, Period, PeriodDetails }; serverReport.SetParameters(parameters); } serverReport.Refresh(); RPT_Report2.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "FrmReport2Data", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { RPT_EmpRatingDetailsReport.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_EmpRatingDetailsReport.ServerReport; Microsoft.Reporting.WebForms.ReportParameter Organisation; Microsoft.Reporting.WebForms.ReportParameter BusinessUnit; Microsoft.Reporting.WebForms.ReportParameter AppraisalCycle; Microsoft.Reporting.WebForms.ReportParameter Status; string sDomain = ConfigurationSettings.AppSettings["MyReportViewerDomain"]; WebClient wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); string MyReportPath = System.Configuration.ConfigurationSettings.AppSettings["MyReportPath"]; serverReport.ReportPath = MyReportPath + "ConsolidationRatingReport"; if (Convert.ToString(Request.QueryString["ORG_ID"]) != "") { Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Request.QueryString["ORG_ID"])); } else { Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", "-1"); } if (Convert.ToString(Request.QueryString["BU"]) != "") { BusinessUnit = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", Convert.ToString(Request.QueryString["BU"])); } else { BusinessUnit = new Microsoft.Reporting.WebForms.ReportParameter("BusinessUnit", "-1"); } if (Convert.ToString(Request.QueryString["AppCycle"]) != "") { AppraisalCycle = new Microsoft.Reporting.WebForms.ReportParameter("AppraisalCycle", Convert.ToString(Request.QueryString["AppCycle"])); } else { AppraisalCycle = new Microsoft.Reporting.WebForms.ReportParameter("AppraisalCycle", "-1"); } if (Convert.ToString(Request.QueryString["Status"]) != "") { Status = new Microsoft.Reporting.WebForms.ReportParameter("Status", Convert.ToString(Request.QueryString["Status"])); } else { Status = new Microsoft.Reporting.WebForms.ReportParameter("Status", "Completed"); } Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Organisation, BusinessUnit, AppraisalCycle, Status }; serverReport.SetParameters(parameters); serverReport.Refresh(); RPT_EmpRatingDetailsReport.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Pms_EmpRatingReport", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { rptStr = Convert.ToString(Request.QueryString["rptStr"]); RPT_Report.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport); serverReport = RPT_Report.ServerReport; Microsoft.Reporting.WebForms.ReportParameter organisation; Microsoft.Reporting.WebForms.ReportParameter Businessunit; Microsoft.Reporting.WebForms.ReportParameter Organisation; string sDomain = ConfigurationSettings.AppSettings["MyReportViewerDomain"]; WebClient wc = new WebClient(); Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials(); serverReport.ReportServerCredentials = _ObjNC; serverReport.ReportServerUrl = new Uri(sDomain); string MyReportPath = System.Configuration.ConfigurationSettings.AppSettings["MyReportPath"]; if (rptStr == "GWE") { serverReport.ReportPath = MyReportPath + "Gradewiseemployeelist"; } if (rptStr == "ECD") { serverReport.ReportPath = MyReportPath + "EmployeeContractDetails"; } if (rptStr == "GDP") { serverReport.ReportPath = MyReportPath + "GeographicalDistributionOfProfessionalPosts"; } if (rptStr == "RAR") { serverReport.ReportPath = MyReportPath + "RetirementAgeReport"; } if (rptStr == "SDR") { serverReport.ReportPath = MyReportPath + "SpouseOrDependantsReport"; } if (rptStr == "ER") { serverReport.ReportPath = MyReportPath + "EmployeeRegister"; } //serverReport.ReportPath = MyReportPath + "EmployeeFamilyDetails"; //if (Convert.ToString(Request.QueryString["ORG_ID"]) != "") //{ // Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Request.QueryString["ORG_ID"])); //} //else //{ // Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", "-1"); //} if (Convert.ToString(Request.QueryString["BU"]) != "") { Businessunit = new Microsoft.Reporting.WebForms.ReportParameter("Businessunit", Convert.ToString(Request.QueryString["BU"])); } else { Businessunit = new Microsoft.Reporting.WebForms.ReportParameter("Businessunit", "-1"); } organisation = new Microsoft.Reporting.WebForms.ReportParameter("organisation", Convert.ToString(Session["ORG_ID"])); Organisation = new Microsoft.Reporting.WebForms.ReportParameter("Organisation", Convert.ToString(Session["ORG_ID"])); if (rptStr == "ECD" || rptStr == "GDP" || rptStr == "RAR" || rptStr == "ER" || rptStr == "SDR") { Microsoft.Reporting.WebForms.ReportParameter[] parameters = { Organisation, Businessunit }; serverReport.SetParameters(parameters); } else { Microsoft.Reporting.WebForms.ReportParameter[] parameters = { organisation, Businessunit }; serverReport.SetParameters(parameters); } serverReport.Refresh(); RPT_Report.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "FrmReport1Data", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }