Beispiel #1
0
 public void GetTop(string id, TONLI.BZH.UI.DSOFramerWordControl tx2)
 {
     byte[] vi = null;
     try
     {
         LayoutType lt1 = Services.BaseService.GetOneByKey <LayoutType>(id);
         if (lt1 != null)
         {
             vi = lt1.ExcelData;
             tx2.DoAppendFromStream(vi);
         }
     }
     catch { }
 }
Beispiel #2
0
        //private void InitExe(string parentid, DataTable dts, IList<LayoutContent> ls)
        //{
        //    DataRow[] rows = dts.Select(string.Format("parentid='{0}'", parentid));

        //    foreach (DataRow row in rows)
        //    {

        //        try
        //        {
        //            if (row["Contents"] != DBNull.Value)
        //            {
        //                byte[] bt = null;
        //                try { bt = (byte[])row["Contents"]; }
        //                catch { }
        //                LayoutContent lc = new LayoutContent();
        //                lc.ChapterName = row["ChapterName"].ToString();

        //                if (bt != null)
        //                {
        //                    lc.Contents = bt;
        //                }
        //                ls.Add(lc);
        //            }

        //        }
        //        catch (Exception ex)
        //        {
        //        }
        //        InitExe(row["UID"].ToString(), dts, ls);
        //    }
        //}

        private void InitAdd(IList <LayoutContent> ls, TONLI.BZH.UI.DSOFramerWordControl tx2)
        {
            foreach (LayoutContent bs in ls)
            {
                try
                {
                    System.Drawing.Font font = new System.Drawing.Font("宋体", 16);
                    tx2.DoInsert("", font, TONLI.BZH.UI.WdParagraphAlignment.Left);
                    tx2.DoInsert("", font, TONLI.BZH.UI.WdParagraphAlignment.Left);
                    font = new System.Drawing.Font("宋体", 32);
                    tx2.DoInsert(bs.ChapterName, font, TONLI.BZH.UI.WdParagraphAlignment.Left);
                    tx2.DoInsert("", font, TONLI.BZH.UI.WdParagraphAlignment.Left);
                    font = new System.Drawing.Font("宋体", 16);
                    tx2.DoAppendFromStream(bs.Contents);
                }
                catch
                {
                }
            }
        }