public override IScope Render(IReportContext context, IScope scope, object item) { scope = scope ?? context.Scope; Template = Template ?? XmlExtensions.Load(FileName, BxlParserOptions.ExtractSingle); Xi = Xi ?? new XmlInterpolation { UseExtensions = true, XmlIncludeProvider = new XmlIncludeProvider { Container = _container } }; IScope ws = null; if (null == context) { ws = scope; } else { ws = new Scope(context.Data); ws["data"] = context.Data; ws["context"] = context; ws["scope"] = scope; ws["item"] = item; ws["reportcode"] = context.Report.Id; ws["reportname"] = context.Report.Name; } var result = Xi.Interpolate(Template, ws); RemoveDebugInfo(scope, result); Finalize(context, scope, result); return(scope); }
public XElement GetXml(string path, XElement current, IScope scope) { if (path.Contains("component://")) { return(ResolveRenderComponent(path, current, scope)); } var filename = path.Contains("@") ? EnvironmentInfo.ResolvePath(path) : path; if (!Path.IsPathRooted(filename)) { var dir = Path.GetDirectoryName(current.Describe().File); filename = Path.Combine(dir, filename); } if (!IncludeCache.ContainsKey(filename)) { var result = IncludeCache[filename] = XmlExtensions.Load(filename, BxlParserOptions.ExtractSingle); Preprocess(result, current, scope); return(result); } return(IncludeCache[filename]); }