/// <summary> /// 序列化报表模板 /// </summary> /// <param name="p_root"></param> /// <returns></returns> internal static string SerializeTemplate(RptRoot p_root) { if (p_root == null) { return(""); } p_root.OnBeforeSerialize(); StringBuilder sb = new StringBuilder(); using (XmlWriter writer = XmlWriter.Create(sb, new XmlWriterSettings() { OmitXmlDeclaration = true, Indent = true })) { p_root.WriteXml(writer); writer.Flush(); } p_root.OnAfterSerialize(); return(sb.ToString()); }