protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session[Constant.PARAMETER_VENDORLIST] == null) { return; } VendorListReportParameter param = (VendorListReportParameter)Session[Constant.PARAMETER_VENDORLIST]; ObjectDataSource1.SelectParameters[0].DefaultValue = param.StartDate.ToString(); ObjectDataSource1.SelectParameters[1].DefaultValue = param.EndDate.ToString(); ReportParameter[] RequestorParameter = new ReportParameter[2]; RequestorParameter[0] = new ReportParameter("StartDate", param.StartDate.ToString()); RequestorParameter[1] = new ReportParameter("EndDate", param.EndDate.ToString()); rvVendorList.LocalReport.ReportPath = Request.PhysicalApplicationPath + @"reports\vendorlist.rdlc"; rvVendorList.LocalReport.SetParameters(RequestorParameter); rvVendorList.ShowReportBody = true; //rvVendorList.LocalReport.Refresh(); } PageTitle.InnerText = String.Format(Constant.TITLEFORMAT, "Vendor List Report"); }
protected void lnkViewReport_Click(object sender, EventArgs e) { VendorListReportParameter param = new VendorListReportParameter(); param.StartDate = DateTime.Parse(clndrStartDate.Text); param.EndDate = DateTime.Parse(clndrEndDate.Text); Session[Constant.PARAMETER_VENDORLIST] = param; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "SHOWWINDOW", "<script type='text/javascript'> window.open('../reports/vendorlist.aspx','r1', 'toolbar=no,width=960, menubar=no, resizable=yes , scrollbars=yes'); </script>"); }