コード例 #1
0
        /// <summary>
        ///  根据报表对象构建对应的xml 文档字符窜。
        /// </summary>
        /// <param name="pReport"></param>
        /// <returns></returns>
        public string BuildXMLString(DIYReport.ReportModel.RptReport pReport)
        {
            StringBuilder xmlSB = new StringBuilder();

            //描述
            xmlSB.Append("<?xml version='1.0' encoding='utf-8' ?>");
            xmlSB.Append("<!-- 用户自定义智能报表中心生成的报表 -->");

            writeFirstMarker(xmlSB, pReport.GetType().FullName);
            xmlSB.Append(reportString(pReport));
            DIYReport.ReportModel.RptSectionList sectionList = pReport.SectionList;

            writeFirstMarker(xmlSB, ReportXmlHelper.SECTION_LIST_MARKER);
            foreach (DIYReport.ReportModel.RptSection section in  sectionList)
            {
                writeFirstMarker(xmlSB, section.GetType().FullName);

                xmlSB.Append(sectionString(section));
                writeFirstMarker(xmlSB, ReportXmlHelper.RPT_OBJ_LIST_MARKER);
                DIYReport.ReportModel.RptSingleObjList rptObjList = section.RptObjList;
                foreach (DIYReport.Interface.IRptSingleObj rptObj in rptObjList)
                {
                    writeFirstMarker(xmlSB, rptObj.GetType().FullName);
                    xmlSB.Append(objectToXml(rptObj));
                    writeLastMarker(xmlSB, rptObj.GetType().FullName);
                }
                writeLastMarker(xmlSB, ReportXmlHelper.RPT_OBJ_LIST_MARKER);
                writeLastMarker(xmlSB, section.GetType().FullName);
            }
            writeLastMarker(xmlSB, ReportXmlHelper.SECTION_LIST_MARKER);
            writeLastMarker(xmlSB, pReport.GetType().FullName);
            return(xmlSB.ToString());
        }
コード例 #2
0
 private void addRptObjList(DIYReport.ReportModel.RptSingleObjList pControls)
 {
     foreach (DIYReport.ReportModel.RptSingleObj obj in pControls)
     {
         string txt = obj.Name + ":" + Enum.GetName(obj.Type.GetType(), obj.Type);
         cobControls.Items.Add(new  DataStrtuct(txt, obj));
     }
 }
コード例 #3
0
 public DesignControlList(DIYReport.UserDIY.DesignSection pSection)
 {
     _Section = pSection;
     _DataObj = pSection.DataObj.RptObjList;
     foreach (DIYReport.Interface.IRptSingleObj obj in _DataObj)
     {
         DesignControl ctl = new DesignControl(obj);
         this.Add(ctl);
     }
 }
コード例 #4
0
        //把对象集合中需要统计计算的对象加入到表达的集合中
        //把需要统计的字段加上表达试做为主键

        #region 构造函数...
        /// <summary>
        ///
        /// </summary>
        /// <param name="pObjects"></param>
        public ExpressValueList(DIYReport.ReportModel.RptSection pSection)
        {
            if (pSection != null)
            {
                DIYReport.ReportModel.RptSingleObjList objList = pSection.RptObjList;
                foreach (DIYReport.ReportModel.RptSingleObj obj in objList)
                {
                    if (obj.Type == DIYReport.ReportModel.RptObjType.Express)
                    {
                        DIYReport.ReportModel.RptObj.RptExpressBox box = obj as DIYReport.ReportModel.RptObj.RptExpressBox;
                        if (box.ExpressType == DIYReport.ReportModel.ExpressType.Express)
                        {
                            this.Add(new ExpressValue(obj));
                        } //end if
                    }     //end if
                }         //end foreach
            }             //end if
        }
コード例 #5
0
ファイル: ReportDataIO.cs プロジェクト: ewin66/CsharpProjects
        private string buildXMLString(DIYReport.ReportModel.RptReport pReport)
        {
            StringBuilder xmlSB = new StringBuilder();

            //描述
            xmlSB.Append("<?xml version='1.0' encoding='utf-8' ?>");
            xmlSB.Append("<!-- 用户自定义智能报表中心生成的报表 -->");
            xmlSB.Append(reportString(pReport));
            DIYReport.ReportModel.RptSectionList sectionList = pReport.SectionList;
            foreach (DIYReport.ReportModel.RptSection section in  sectionList)
            {
                xmlSB.Append(sectionString(section));
                DIYReport.ReportModel.RptSingleObjList rptObjList = section.RptObjList;
                foreach (DIYReport.Interface.IRptSingleObj rptObj in rptObjList)
                {
                    xmlSB.Append(rptObjString(rptObj));
                }
                xmlSB.Append("</RptSection>");
            }
            xmlSB.Append("</RptReport>");
            return(xmlSB.ToString());
        }