public ISlideCollection _plus_jp_yangguang100aerle_1(string str, int cjbh) { try { var param = Cache_param_zb._param_jp.Where(m => m.cjid == cjbh); var p = new Presentation(); var t = p.Slides; t.RemoveAt(0); foreach (var item in param) { var tp = new Presentation(str); var temp = tp.Slides; var page1 = temp[0]; IAutoShape text0_1 = (IAutoShape)page1.Shapes[1]; text0_1.TextFrame.Text = string.Format(text0_1.TextFrame.Text, item.bamc, item.ytcs[0]); var page2 = temp[1]; DataTable dt2_0 = new DataTable(); dt2_0.Columns.Add(Base_Config_Jzgj.项目名称); dt2_0.Columns.Add(Base_Config_Rgsj.本周_新开套数); dt2_0.Columns.Add(Base_Config_Rgsj.本周_新开销售套数); dt2_0.Columns.Add(Base_Config_Rgsj.本周_新开建面均价); dt2_0.Columns.Add(Base_Config_Rgsj.本周_本周来电); dt2_0.Columns.Add(Base_Config_Rgsj.本周_本周到访量); dt2_0.Columns.Add(Base_Config_Cjba.周_备案套数); dt2_0.Columns.Add(Base_Config_Cjba.周_建面均价); dt2_0.Columns.Add(Base_Config_Cjba.周_套均总价); dt2_0.Columns.Add(Base_Config_Cjba.周_建筑面积); dt2_0.Columns.Add(Base_Config_Cjba.周_成交金额); dt2_0.Columns.Add(Base_Config_Rgsj.周_认购套数); dt2_0.Columns.Add(Base_Config_Rgsj.周_认购建面均价); dt2_0.Columns.Add(Base_Config_Rgsj.周_认购金额); dt2_0.Columns.Add(Base_Config_Cjba.本周_备案套数); dt2_0.Columns.Add(Base_Config_Cjba.本周_建面均价); dt2_0.Columns.Add(Base_Config_Cjba.本周_套均总价); dt2_0.Columns.Add(Base_Config_Cjba.本周_建筑面积); dt2_0.Columns.Add(Base_Config_Cjba.本周_成交金额); dt2_0.Columns.Add(Base_Config_Rgsj.本周_认购套数); dt2_0.Columns.Add(Base_Config_Rgsj.本周_认购建面均价); dt2_0.Columns.Add(Base_Config_Rgsj.本周_认购金额); dt2_0.Columns.Add("剩余套数"); dt2_0.Columns.Add(Base_Config_Rgsj.本周_变化原因); dt2_0 = GET_JPBA_BX(dt2_0, item); if (item.jpxmlb != null && item.jpxmlb.Count > 0) { IAutoShape text2 = (IAutoShape)page2.Shapes[1]; text2.TextFrame.Text = string.Format(text2.TextFrame.Text, item.bamc, item.ytcs[0]); dt2_0 = GET_JPXM_BX(dt2_0, item.jpxmlb); Office_Tables.SetJP_CHONGQING18TI_Table(page2, dt2_0, 2, null, null); t.AddClone(page2); } var page3 = temp[2]; IAutoShape text3 = (IAutoShape)page3.Shapes[1]; text3.TextFrame.Text = string.Format(text3.TextFrame.Text, item.bamc, item.ytcs[0]); DataTable dt1 = new DataTable(); dt1.Columns.Add(Base_Config_Jzgj.项目名称); dt1.Columns.Add(Base_Config_Rgsj.本周_优惠); dt1.Columns.Add(Base_Config_Rgsj.本周_活动); dt1.Columns.Add(Base_Config_Rgsj.本周_优惠); if (item.jpxmlb != null && item.jpxmlb.Count > 0) { dt1 = GET_JPXM_BX(dt1, item.jpxmlb); Office_Tables.SetTable(page3, dt1, 2, null, null); } t.AddClone(page3); if (item.jpxmlb != null && item.jpxmlb.Count > 0) { foreach (var jpitem in item.jpxmlb) { var tp1 = new Presentation(str); var temp1 = tp1.Slides; var page4 = temp1[3]; DataTable dttemp = Cache_data_cjjl.jbz.Select("zc>=" + (Base_date.bz - 3)).CopyToDataTable(); var data = from a in dttemp.AsEnumerable() where a["lpmc"].ToString() == jpitem.lpcs[0] && a["yt"].ToString() == jpitem.ytcs[0] group a by new { zc = a["zc"], zcmc = a["zcmc"] } into s select new { zc = s.Key.zc, zcmc = s.Key.zcmc, ts = s.Sum(m => m["ts"].ints()), jmjj = s.Sum(m => m["cjje"].longs()) / s.Sum(m => m["jzmj"].doubls()) }; DataTable dt4_0 = new DataTable(); dt4_0.Columns.Add("周次名称"); dt4_0.Columns.Add("精装成交套数"); dt4_0.Columns.Add("精装成交均价"); foreach (var tempitem in data) { DataRow dr = dt4_0.NewRow(); dr["周次名称"] = tempitem.zcmc; dr["精装成交套数"] = tempitem.ts; dr["精装成交均价"] = tempitem.jmjj.je_y(); dt4_0.Rows.Add(dr); } IAutoShape text4_0 = (IAutoShape)page4.Shapes[0]; text4_0.TextFrame.Text = string.Format(text4_0.TextFrame.Text, item.bamc, item.ytcs[0]); IAutoShape text4_1 = (IAutoShape)page4.Shapes[1]; text4_1.TextFrame.Text = string.Format(text4_1.TextFrame.Text, jpitem.lpcs[0], jpitem.ytcs[0]); //无法将类型为“Aspose.Slides.OleObjectFrame”的对象强制转换为类型“Aspose.Slides.Charts.IChart”。 //Office_Charts.Chart_gxfx(pag4, dt4_0, 2); t.AddClone(page4); var pag5 = temp1[4]; IAutoShape text5_0 = (IAutoShape)pag5.Shapes[1]; text5_0.TextFrame.Text = string.Format(text5_0.TextFrame.Text, item.bamc, item.ytcs[0]); IAutoShape text5_1 = (IAutoShape)pag5.Shapes[2]; text5_1.TextFrame.Text = string.Format(text5_1.TextFrame.Text, jpitem.lpcs[0], jpitem.ytcs[0]); t.AddClone(pag5); } } } return(t); } catch (Exception e) { Base_Log.Log(e.Message); return(null); } }
public ISlideCollection _plus_jp_huguanghuiguan_1(string str, int cjbh) { try { var param = Cache_param_zb._param_jp.Where(m => m.cjid == cjbh); var p = new Presentation(); var t = p.Slides; t.RemoveAt(0); foreach (var item in param) { var query = from a in item.jpxmlb group a by new { jzgjid = a.jzgjid } into m select new { jzgjid = m.Key.jzgjid, }; List <List <JP_JPXM_INFO> > list = new List <List <JP_JPXM_INFO> >(); foreach (var jzgjid in query) { List <JP_JPXM_INFO> jpxm = item.jpxmlb.Where(m => m.jzgjid == jzgjid.jzgjid).ToList(); list.Add(jpxm); } var tp = new Presentation(str); var temp = tp.Slides; var page1 = temp[0]; IAutoShape text0_1 = (IAutoShape)page1.Shapes[2]; text0_1.TextFrame.Text = string.Format(text0_1.TextFrame.Text, item.bamc, item.ytcs[0]); var page2 = temp[1]; DataTable dt2_0 = new DataTable(); dt2_0.Columns.Add(Base_Config_Jzgj.竞争格局_主力面积区间); dt2_0.Columns.Add(Base_Config_TJXM.区域); dt2_0.Columns.Add(Base_Config_Jzgj.项目名称); dt2_0.Columns.Add(Base_Config_Rgsj.本周_新开套数); dt2_0.Columns.Add(Base_Config_Rgsj.本周_新开销售套数); dt2_0.Columns.Add(Base_Config_Rgsj.周_本周到访量); dt2_0.Columns.Add(Base_Config_Rgsj.周_本周来电); dt2_0.Columns.Add(Base_Config_Rgsj.周_认购套数); dt2_0.Columns.Add(Base_Config_Rgsj.周_认购建面均价); dt2_0.Columns.Add(Base_Config_Rgsj.本周_本周到访量); dt2_0.Columns.Add(Base_Config_Rgsj.本周_本周来电); dt2_0.Columns.Add(Base_Config_Rgsj.本周_认购套数); dt2_0.Columns.Add(Base_Config_Rgsj.本周_认购建面均价); dt2_0.Columns.Add(Base_Config_Rgsj.本周_优惠); dt2_0.Columns.Add("总结"); if (item.jpxmlb != null && item.jpxmlb.Count > 0) { dt2_0 = GET_JPXM_BX(dt2_0, item.jpxmlb); Office_Tables.SetJP_CHONGQING18TI_Table(page2, dt2_0, 0, null, null); t.AddClone(page2); } if (item.jpxmlb != null && item.jpxmlb.Count > 0) { foreach (var jpitem in item.jpxmlb) { var tp1 = new Presentation(str); var temp1 = tp1.Slides; var page4 = temp1[3]; DataTable dttemp = Cache_data_cjjl.jbz.Select("zc>=" + (Base_date.bz - 3)).CopyToDataTable(); var data = from a in dttemp.AsEnumerable() where a["lpmc"].ToString() == jpitem.lpcs[0] && a["yt"].ToString() == jpitem.ytcs[0] group a by new { zc = a["zc"], zcmc = a["zcmc"] } into s select new { zc = s.Key.zc, zcmc = s.Key.zcmc, ts = s.Sum(m => m["ts"].ints()), jmjj = s.Sum(m => m["cjje"].longs()) / s.Sum(m => m["jzmj"].doubls()) }; DataTable dt4_0 = new DataTable(); dt4_0.Columns.Add("周次名称"); dt4_0.Columns.Add("精装成交套数"); dt4_0.Columns.Add("精装成交均价"); foreach (var tempitem in data) { DataRow dr = dt4_0.NewRow(); dr["周次名称"] = tempitem.zcmc; dr["精装成交套数"] = tempitem.ts; dr["精装成交均价"] = tempitem.jmjj.je_y(); dt4_0.Rows.Add(dr); } IAutoShape text4_0 = (IAutoShape)page4.Shapes[0]; text4_0.TextFrame.Text = string.Format(text4_0.TextFrame.Text, item.bamc, item.ytcs[0]); IAutoShape text4_1 = (IAutoShape)page4.Shapes[1]; text4_1.TextFrame.Text = string.Format(text4_1.TextFrame.Text, jpitem.lpcs[0], jpitem.ytcs[0]); //无法将类型为“Aspose.Slides.OleObjectFrame”的对象强制转换为类型“Aspose.Slides.Charts.IChart”。 //Office_Charts.Chart_gxfx(pag4, dt4_0, 2); t.AddClone(page4); var pag5 = temp1[4]; IAutoShape text5_0 = (IAutoShape)pag5.Shapes[1]; text5_0.TextFrame.Text = string.Format(text5_0.TextFrame.Text, item.bamc, item.ytcs[0]); IAutoShape text5_1 = (IAutoShape)pag5.Shapes[2]; text5_1.TextFrame.Text = string.Format(text5_1.TextFrame.Text, jpitem.lpcs[0], jpitem.ytcs[0]); t.AddClone(pag5); } } } return(t); } catch (Exception e) { Base_Log.Log(e.Message); return(null); } }