public void CreateControls(ReportFilterCollection list) { if (!this.isCreated) { try { if (!list.IsEmptyList()) { foreach (var item in list) { Control ctrl = item.CreateSearchControl(this.Page); this.Controls.Add(ctrl); } } this.isCreated = true; } catch(HttpException hex) { if (hex.Message.Contains("Failed to load viewstate")) { StringBuilder sbScript = new StringBuilder(); sbScript.Append("<script language='JavaScript' type='text/javascript'>\n"); sbScript.Append("<!--\n"); sbScript.Append(this.Page.ClientScript.GetPostBackEventReference(this, "PBArg") + ";\n"); sbScript.Append("// -->\n"); sbScript.Append("</script>\n"); this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "AutoPostBackScript", sbScript.ToString()); } else throw; } } }
public static ReportFilterCollection GetAllReportFilterXml() { ReportFilterCollection ret = new ReportFilterCollection(); Report parent = Sessions.CurrentReport; if (null != parent) { foreach (DataSource ds in parent.DataSources) { ReportFilterCollection list = ReportFilterCollection.FromJson(ds.ReportFilterXml); foreach (FilterBase fb in list) { fb.Parent = ds; ret.Add(fb); } } } return ret; }