using NPOI.HSSF.UserModel;
 using NPOI.POIFS.FileSystem;
 using org.in2bits.MyXls;
 using System;
 using System.Collections.Generic;
 using System.Data;
 using System.IO;
 using System.Linq;
 using System.Text;
 using System.Web;
 using System.Web.UI;
 using System.Web.UI.WebControls;
 using Topevery.Basis.Config;
 using Topevery.Basis.Logic;
 using Topevery.DUM.Entity;

 namespace Topevery.DUM.Report.PublicCaseAnalysis
 {
     public partial class EvtSpread : BasePage
     {
         protected void Page_Load(object sender, EventArgs e)
         {
             if (!this.IsPostBack)
             {
                 //txtStartDate.Text = string.Format("{0}-{1}-1", DateTime.Today.Year, DateTime.Today.Month);
                 //txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Today);
                 txtStartDate.Text = "2015-01-01";
                 txtEndDate.Text = "2016-08-01";
             }

             AjaxPro.Utility.RegisterTypeForAjax(typeof(EvtSpread));
         }

         /// <summary>
         /// 分布统计查询
         /// </summary>
         /// <param name="evtPara"></param>
         /// <returns></returns>
         [AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement.Read)]
         public static EvtSpreadData GetZxEvtSpreadData(SearchPara evtPara)
         {
             EvtSpreadData result = new EvtSpreadData();

             //1.查出所有数据
             BaseParameter para = new BaseParameter();

             para.PageIndex = ;
             para.PageSize = int.MaxValue;

             string title = "";

             //lblTitle.Text = string.Format("{0:yyyy-MM-01}至{1:MM-dd}{3}专项案件分布统计", DateTime.Today);
             if (!string.IsNullOrEmpty(evtPara.DateBegin))
             {
                 DateTime dtStart = DateTime.Now;
                 if (DateTime.TryParse(evtPara.DateBegin, out dtStart))
                 {
                     title += string.Format("{0:yyyy-MM-dd}—", dtStart);
                     para.BeginDate = dtStart;
                 }
             }

             if (!string.IsNullOrEmpty(evtPara.DateEnd))
             {
                 DateTime dtEnd = DateTime.Now;
                 if (DateTime.TryParse(evtPara.DateEnd, out dtEnd))
                 {
                     title += string.Format("{0:yyyy-MM-dd}", dtEnd);
                     para.EndDate = dtEnd.AddDays().AddSeconds(-);
                 }
             }

             title += "案件分布统计";

             ;
             DataTable dt = QmcgLogic.EvtSearchList(para);
             if (dt != null)
             {
                 recordCount = dt.Rows.Count;
             }

             StringBuilder StrbSprdHtm = new StringBuilder();
             string strTableClass = "TUI-grid-list";
             StrbSprdHtm.AppendFormat("<table class='{0}' ><colgroup ><col width='30px'><col width='120px' /><col/><col/></colgroup><tr><th>序号</th><th class='AeraName ui-th-column'>区域</th><th class='EvtCount ui-th-column'>案件数</th></tr>", strTableClass);

             //循环各个区域
             Topevery.Basis.Entity.SysMapTreeCollection mapTreeColl = SysMapLogic.GetDefaultTree();
             )
             {
                 foreach (Topevery.Basis.Entity.SysMapTree mapCity in mapTreeColl)
                 {
                     ;
                     //市下面的区循环
                     foreach (Topevery.Basis.Entity.SysMapTree mapDist in mapCity.Child)
                     {
                         iDistCount++;
                         string strDistTrStyle = "ui-widget-content jqgrow ui-row-ltr ui-priority-secondary";
                          == )
                         {
                             strDistTrStyle = "ui-widget-content jqgrow ui-row-ltr";
                         }
                         strDistTrStyle = string.Format("{0} {1}", Topevery.Basis.Config.MapTypeEnum.District, strDistTrStyle);
                         )
                         {
                             //int prbInDistCount = 0;
                             int evtInDistCount = GetEvtCountByMap(dt, mapDist.ID, Topevery.Basis.Config.MapTypeEnum.District);
                             //
                             StrbSprdHtm.AppendFormat("<tr class='{2}' mapId='{3}'><td>{4}</td><td class='AeraName'><a class='TUI-link-btn fl-left' href='javascript:void(0);' onclick='showOrHideStreet(this);'><span class='ui-icon ui-icon-minus'></span></a><a href='javascript:mapPositions({3})'>{0}</a></td><td class='EvtCount'><a href='javascript:void(0);' onclick='showDetail(this,{3},13002)'>{1}</a></td></tr>", mapDist.Name, evtInDistCount, strDistTrStyle, mapDist.ID, iDistCount);

                             )
                             {
                                 StrbSprdHtm.AppendFormat("<tr class='{0}_Out'><td></td><td colspan='2' border='0'>", MapTypeEnum.Street);
                                 StrbSprdHtm.AppendFormat("<table class='{0}'><colgroup ><col width='30px'><col width='120px' /><col/><col/></colgroup><tr><th>序号</th><th class='AeraName ui-th-column'>街道</th><th class='EvtCount ui-th-column'>案件数</th></tr>", strTableClass);
                                 ;
                                 //循环区下面的街道
                                 foreach (Topevery.Basis.Entity.SysMapTree mapStreet in mapDist.Child)
                                 {
                                     string strStreetStyle = "ui-widget-content jqgrow ui-row-ltr ui-priority-secondary";
                                      == )
                                     {
                                         strStreetStyle = "ui-widget-content jqgrow ui-row-ltr";
                                     }
                                     //int prbInStreetCount = 0;
                                     int evtInStreetCount = GetEvtCountByMap(dt, mapStreet.ID, Topevery.Basis.Config.MapTypeEnum.Street);
                                     )
                                     {
                                         iStreetCount++;
                                         StrbSprdHtm.AppendFormat("<tr class='{2}_Inner {5}' mapId='{3}'><td>{6}</td><td class='AeraName'><a class='TUI-link-btn fl-left' href='javascript:void(0);' onclick='showOrHideCmn(this);'><span class='ui-icon ui-icon-plus'></span></a><a href='javascript:mapPositions({3})'>{0}</a></td><td class='EvtCount'><a href='javascript:void(0);' onclick='showDetail(this,{3},13003)'>{1}</a></td></tr><tr class='{4}_Out' style='display:none'><td></td><td colspan='2'>", mapStreet.Name, evtInStreetCount, MapTypeEnum.Street, mapStreet.ID, MapTypeEnum.Community, strStreetStyle, iStreetCount);
                                         StrbSprdHtm.AppendFormat("<table class='{0}'><colgroup><col width='30px'><col width='120px' /><col/><col/></colgroup><tr><th>序号</th><th class='AeraName ui-th-column'>社区</th><th class='EvtCount ui-th-column'>案件数</th></tr>", strTableClass);

                                         ;
                                         //循环街道下面的社区
                                         foreach (Topevery.Basis.Entity.SysMapTree mapComn in mapStreet.Child)
                                         {
                                             //int prbInCmnCount = 0;
                                             int evtInCmnCount = GetEvtCountByMap(dt, mapComn.ID, Topevery.Basis.Config.MapTypeEnum.Community);
                                             )
                                             {
                                                 iCmnCount++;
                                                 StrbSprdHtm.AppendFormat("<tr class='{2}_Inner' mapId='{3}'><td>{4}</td><td class='AeraName'><a href='javascript:mapPositions({3})'>{0}</a></td><td class='EvtCount'><a href='javascript:void(0);' onclick='showDetail(this,{3},13004)'>{1}</a></td></tr>", mapComn.Name, evtInCmnCount, MapTypeEnum.Community, mapComn.ID, iCmnCount);
                                             }

                                         }
                                         StrbSprdHtm.Append("</table></td></tr>");
                                     }
                                 }
                                 StrbSprdHtm.Append("</table>");
                             }
                             else
                             {
                                 StrbSprdHtm.AppendFormat("<tr class='{0}_Out' style='display:none;'><td></td><td colspan='2' border='0'>", MapTypeEnum.Street);
                             }
                             StrbSprdHtm.Append("</td></tr>");
                         }
                     }

                     StrbSprdHtm.Append("</table>");

                     StrbSprdHtm.Append("</td></tr>");
                 }
             }

             StrbSprdHtm.Append("</table>");

             result.SprHtmlResult = StrbSprdHtm.ToString();
             result.Title = title;
             //ExportQueryService.SetQueryVal(ExportEnumKey, para);
             foreach (DataRow dr in dt.Rows)
             {
                 try
                 {
                     Evt evt = new Evt();
                     evt.EvtId = Convert.ToInt64(dr["c_id"]);

                     try
                     {
                         evt.AbsX = Convert.ToDouble(dr["c_abs_x"]);

                         evt.AbsY = Convert.ToDouble(dr["c_abs_y"]);
                     }
                     catch { }

                     try
                     {
                         evt.DistId = Convert.ToInt32(dr["c_map_district_id"]);
                         evt.StreetId = Convert.ToInt32(dr["c_map_street_id"]);
                         evt.CmnId = Convert.ToInt32(dr["c_map_community_id"]);
                     }
                     catch { }

                     evt.Title = Convert.ToString(dr["c_title"]);

                     //evt.Status = Convert.ToInt32(dr["c_status"]);

                     result.ListEvt.Add(evt);
                 }
                 catch { }
             }
             return result;

         }

         /// <summary>
         /// 导出excel文件
         /// </summary>
         /// <param name="reportTitle">标题</param>
         /// <param name="dt">数据源</param>
         /// <param name="columns">列名</param>
         /// <param name="filePath">文件路径</param>
         /// <param name="maxRow">一页显示最大记录数</param>
         public static void SingleExport(string reportTitle, string subTitle, DataTable dt, Dictionary<string, string> columns, string filePath, int maxRow)
         {
             int WorkSheetCount = Convert.ToInt32(Math.Ceiling(dt.Rows.Count * 1.0 / maxRow));
             XlsDocument doc = new XlsDocument();
             ; i < WorkSheetCount; i++)
             {
                 Worksheet sheet = doc.Workbook.Worksheets.Add());

                 ;
                 ;
                 int currentMinRowIndex = i * maxRow;
                 ;
                 ) * maxRow + ) < dt.Rows.Count)
                     currentMaxRowIndex = (i + ) * maxRow;
                 else
                     currentMaxRowIndex = dt.Rows.Count;

                 //标题
                 if (!string.IsNullOrEmpty(reportTitle))
                 {
                     rowIndex++;

                     XF cellXF = doc.NewXF();
                     cellXF.VerticalAlignment = VerticalAlignments.Centered;
                     cellXF.HorizontalAlignment = HorizontalAlignments.Centered;
                     cellXF.Font.Height =  * ;
                     cellXF.Font.Bold = true;
                     //cellXF.Pattern = 1;//设定单元格填充风格。如果设定为0,则是纯色填充
                     //cellXF.PatternBackgroundColor = Colors.EgaYellow;//填充的底色
                     //cellXF.PatternColor = Colors.Grey;//设定填充线条的颜色

                     sheet.Cells.Add(rowIndex, , reportTitle, cellXF);
                     MergeArea area = , , , columns.Count);
                     sheet.AddMergeArea(area);
                 }
                 //副标题
                 if (!string.IsNullOrEmpty(subTitle))
                 {
                     rowIndex++;

                     XF cellXF = doc.NewXF();
                     cellXF.VerticalAlignment = VerticalAlignments.Centered;
                     cellXF.HorizontalAlignment = HorizontalAlignments.Centered;

                     sheet.Cells.Add(rowIndex, , subTitle, cellXF);
                     MergeArea area = , , , columns.Count);
                     sheet.AddMergeArea(area);
                 }

                 //列头标题
                 rowIndex++;
                 foreach (string colTitle in columns.Values)
                 {
                     colIndex++;

                     XF cellXF = doc.NewXF();
                     cellXF.VerticalAlignment = VerticalAlignments.Centered;
                     cellXF.HorizontalAlignment = HorizontalAlignments.Centered;
                     cellXF.Font.Bold = true;
                     cellXF.Pattern = ;//设定单元格填充风格。如果设定为0,则是纯色填充
                     cellXF.PatternBackgroundColor = Colors.Grey;//填充的底色

                     cellXF.TopLineColor = Colors.Black;
                     cellXF.TopLineStyle = ;
                     cellXF.BottomLineColor = Colors.Black;
                     cellXF.BottomLineStyle = ;
                     cellXF.LeftLineColor = Colors.Black;
                     cellXF.LeftLineStyle = ;
                     cellXF.RightLineColor = Colors.Black;
                     cellXF.RightLineStyle = ;

                     sheet.Cells.Add(rowIndex, colIndex, colTitle, cellXF);

                 }

                 //数据行
                 for (int j = currentMinRowIndex; j < currentMaxRowIndex; j++)
                 {
                     rowIndex++;
                     colIndex = ;

                     XF cellXF = doc.NewXF();
                     cellXF.VerticalAlignment = VerticalAlignments.Centered;
                     cellXF.HorizontalAlignment = HorizontalAlignments.Centered;

                     cellXF.TopLineColor = Colors.Black;
                     cellXF.TopLineStyle = ;
                     cellXF.BottomLineColor = Colors.Black;
                     cellXF.BottomLineStyle = ;
                     cellXF.LeftLineColor = Colors.Black;
                     cellXF.LeftLineStyle = ;
                     cellXF.RightLineColor = Colors.Black;
                     cellXF.RightLineStyle = ;

                     foreach (string colName in columns.Keys)
                     {
                         colIndex++;
                         object v = dt.Rows[j][colName];
                         if (v is Int32 || v is Int16 || v is Int64 || v is Double || v is Single)
                         {
                             sheet.Cells.Add(rowIndex, colIndex, v == null || v == DBNull.Value ? "" : v, cellXF);
                         }
                         else
                         {
                             sheet.Cells.Add(rowIndex, colIndex, v == null || v == DBNull.Value ? "" : v.ToString(), cellXF);
                         }
                     }
                 }
             }

             doc.FileName = Guid.NewGuid().ToString() + ".xls";
             if (!string.IsNullOrEmpty(filePath))
             {
                 doc.Save(filePath);
             }
             else
             {

                 string folder = HttpContext.Current.Server.MapPath("~/Templates");

                 try
                 {
                     foreach (string file in System.IO.Directory.GetFiles(folder))
                     {
                         System.IO.FileInfo fi = new System.IO.FileInfo(file);
                         )
                         {
                             System.IO.File.Delete(file);
                         }
                     }
                 }
                 catch { }
                 doc.Save(folder);
                 System.Web.HttpContext.Current.Response.WriteFile("~/Templates/" + doc.FileName);
             }
         }

         public const string ExportEnumKey = ExportKey.Regional;

         public static int GetEvtCountByMap(DataTable evtData, int mapId, Topevery.Basis.Config.MapTypeEnum mapType)
         {
             //prbCount = 0;
             try
             {
                 string filter = "";
                 switch (mapType)
                 {
                     case MapTypeEnum.District:
                         filter = string.Format("[c_map_district_id]={0}", mapId);
                         break;
                     case MapTypeEnum.Street:
                         filter = string.Format("[c_map_street_id]={0}", mapId);
                         break;
                     case MapTypeEnum.Community:
                         filter = string.Format("[c_map_community_id]={0}", mapId);
                         break;
                 }

                 //object oPrbCount = evtData.Compute("sum([c_count])", filter);
                 //try
                 //{
                 //    prbCount = Convert.ToInt32(oPrbCount);
                 //}
                 //catch { }
                 return evtData.Select(filter).Length;
             }
             catch { }

             ;
         }

         protected void Download_Click(object sender, EventArgs e)
         {

             ;
             BaseParameter para = new BaseParameter();
             string title = "";
             if (!string.IsNullOrEmpty(txtStartDate.Text))
             {
                 DateTime dtStart = DateTime.Now;
                 if (DateTime.TryParse(txtStartDate.Text, out dtStart))
                 {
                     title += string.Format("{0:yyyy-MM-dd}—", dtStart);
                     para.BeginDate = dtStart;
                 }
             }
             if (!string.IsNullOrEmpty(txtEndDate.Text))
             {
                 DateTime dtEnd = DateTime.Now;
                 if (DateTime.TryParse(txtEndDate.Text, out dtEnd))
                 {
                     title += string.Format("{0:yyyy-MM-dd}", dtEnd);
                     para.EndDate = dtEnd.AddDays().AddSeconds(-);
                 }
             }
             DataTable dt = QmcgLogic.EvtSearchList(para);
             if (dt != null)
             {
                 recordCount = dt.Rows.Count;
             }
             List<string> subTitles = new List<string>();
             Dictionary<string, string> cols = new Dictionary<string, string>();
             DataTable dtnew = new DataTable("casetable");
             dtnew.Columns.Add(new DataColumn("Id", typeof(Int32)));
             dtnew.Columns.Add(new DataColumn("Region", typeof(string)));
             dtnew.Columns.Add(new DataColumn("CaseNumber", typeof(Int32)));
             dtnew.Columns.Add("c_level");
             dtnew.Columns.Add("c_parent_id");
             DataRow dr;
             Topevery.Basis.Entity.SysMapTreeCollection mapTreeColl = SysMapLogic.GetDefaultTree();
             )
             {

                 foreach (Topevery.Basis.Entity.SysMapTree mapCity in mapTreeColl)
                 {
                     ;
                     ;
                     //市下面的区循环
                     foreach (Topevery.Basis.Entity.SysMapTree mapDist in mapCity.Child)
                     {
                         id++;
                         iDistCount++;
                         )
                         {
                             //区域案件数
                             int evtInDistCount = GetEvtCountByMap(dt, mapDist.ID, Topevery.Basis.Config.MapTypeEnum.District);
                             dr = dtnew.NewRow();
                             dr["Id"] = mapDist.ID;
                             dr["Region"] = mapDist.Name;
                             dr["CaseNumber"] = evtInDistCount;
                             dr[;
                             dr[;
                             dtnew.Rows.Add(dr);
                             //街道
                             ;
                             )
                             {
                                 foreach (Topevery.Basis.Entity.SysMapTree mapStreet in mapDist.Child)
                                 {
                                     id++;
                                     iStreetCount++;
                                     //案件数
                                     int StreetCount = GetEvtCountByMap(dt, mapStreet.ID, Topevery.Basis.Config.MapTypeEnum.Street);
                                     dr = dtnew.NewRow();
                                     dr["Id"] = mapStreet.ID;
                                     //dr["Id"] = iStreetCount;
                                     dr["Region"] = mapStreet.Name;
                                     dr["CaseNumber"] = StreetCount;
                                     dr[;
                                     dr["c_parent_id"] = mapDist.ID;
                                     dtnew.Rows.Add(dr);
                                     //社区
                                     int evtInStreetCount = GetEvtCountByMap(dt, mapStreet.ID, Topevery.Basis.Config.MapTypeEnum.Street);
                                     )
                                     {
                                         ;
                                         foreach (Topevery.Basis.Entity.SysMapTree mapComn in mapStreet.Child)
                                         {
                                             //案件数
                                             int evtInCmnCount = GetEvtCountByMap(dt, mapComn.ID, Topevery.Basis.Config.MapTypeEnum.Community);
                                             )
                                             {
                                                 id++;
                                                 iCmnCount++;
                                                 dr = dtnew.NewRow();
                                                 dr["Id"] = mapComn.ID;
                                                 //dr["Id"] = iCmnCount;
                                                 dr["Region"] = mapComn.Name;
                                                 dr["CaseNumber"] = evtInCmnCount;
                                                 dr[;
                                                 dr["c_parent_id"] = mapStreet.ID;
                                                 dtnew.Rows.Add(dr);
                                                 Dictionary<string, string> CaseColumns = new Dictionary<string, string>();
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
                 //-----------------------
                 string filePath = System.IO.Path.Combine(Request.PhysicalApplicationPath, "tempFolder");
                 filePath = System.IO.Path.Combine(filePath, Guid.NewGuid().ToString() + ".xls");
                 HSSFWorkbook hssfWorkBook = new HSSFWorkbook();
                 HSSFSheet sheet1 = hssfWorkBook.CreateSheet("Sheet1") as HSSFSheet;
                 using (FileStream file = new FileStream(filePath, FileMode.Create))
                 {
                     hssfWorkBook.Write(file);
                 }
                 HSSFCellStyle _style = sheet1.Workbook.CreateCellStyle() as HSSFCellStyle;
                 _style.Alignment = NPOI.SS.UserModel.HorizontalAlignment.CENTER;
                 _style.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.CENTER;

                 _style.BorderBottom = NPOI.SS.UserModel.CellBorderType.THIN;
                 _style.BottomBorderColor = ;

                 _style.BorderLeft = NPOI.SS.UserModel.CellBorderType.THIN;
                 _style.LeftBorderColor = ;

                 _style.BorderRight = NPOI.SS.UserModel.CellBorderType.THIN;
                 _style.RightBorderColor = ;

                 _style.BorderTop = NPOI.SS.UserModel.CellBorderType.THIN;
                 _style.TopBorderColor = ;
                 DataRow[] drDists = dtnew.Select("c_level=1");
                  sheet1.CreateRow();
                  HSSFCell cell1 = sheet1.GetRow().CreateCell() as HSSFCell;
                  HSSFCell cell2 = sheet1.GetRow().CreateCell() as HSSFCell;
                  HSSFCell cell3 = sheet1.GetRow().CreateCell() as HSSFCell;
                  cell1.SetCellValue("序号");
                  cell2.SetCellValue("区域");
                  cell3.SetCellValue("案件数");

                 foreach (DataRow drDist in drDists)
                 {
                     WriteExcelDataRowX(sheet1, dtnew, drDist, _style);
                 }

                 using (MemoryStream ms = new MemoryStream())
                 {
                     hssfWorkBook.Write(ms);
                     Response.Charset = "utf-8";
                     Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
                     string titleString = string.Empty;
                     )
                     {
                         titleString = "\"" + "区域案件分布统计表" + ".xls\"";
                         Response.AddHeader("Content-Disposition", "attachment;filename=" + titleString);
                     }
                     else
                     {
                         Response.AddHeader("Content-Disposition", string.Format("attachment;filename={0}", System.Web.HttpUtility.UrlEncode("区域案件分布统计表", System.Text.Encoding.UTF8) + ".xls"));
                     }
                     Response.BinaryWrite(ms.ToArray());

                     Response.End();
                 }

                 //********************************************************************************************************

             }
         }

         void WriteExcelDataRowX(HSSFSheet sheet, DataTable allData, DataRow row, HSSFCellStyle style)
         {
             //NPOI向单元格写入值
             //从此二行创建
             ;
             sheet.CreateRow(rowIndex);

             ; i <= ; i++)
             {
                 //HSSFCell cell1 = sheet.GetRow(rowIndex).CreateCell(i) as HSSFCell;
                 //if (i == 0)
                 //{
                 //    cell1.SetCellValue("序号");
                 //}
                 //else if (i == 1)
                 //{
                 //    cell1.SetCellValue("区域");
                 //}
                 //else
                 //{
                 //    cell1.SetCellValue("案件数");
                 //}
                 HSSFCell cell = sheet.GetRow(rowIndex).GetCell(i) as HSSFCell;

                 if (cell == null)
                 {
                     cell = sheet.GetRow(rowIndex).CreateCell(i) as HSSFCell;

                 }
                 cell.CellStyle = style;
                 )
                 {
                     //序号
                     cell.SetCellValue(Helper.GetDataValue(rowIndex, string.Empty));
                 }
                 )
                 {
                     //区域
                     cell.SetCellValue(Helper.GetDataValue(row["Region"], string.Empty));
                 }
                 else
                 {
                     //案件数
                     cell.SetCellValue(Helper.GetDataValue(row["CaseNumber"], string.Empty));
                 }

             }

             //next level
             DataRow[] childData = allData.Select(string.Format("[c_parent_id]={0}", row["Id"]));

             )
             {
                 int curIndex = sheet.LastRowNum;
                 foreach (DataRow childRow in childData)
                 {
                     WriteExcelDataRowX(sheet, allData, childRow, style);
                 }
                 sheet.GroupRow(curIndex + , sheet.LastRowNum);
             }
         }
     }

     [Serializable]
     [AjaxPro.AjaxNoTypeUsage]
     public class SearchPara
     {
         public string DateBegin;
         public string DateEnd;
         //public string EvtStatus;
         //public int TaskId = 0;
     }

     [Serializable]
     [AjaxPro.AjaxNoTypeUsage]
     public class EvtSpreadData
     {
         public List<Evt> ListEvt = new List<Evt>();

         public string SprHtmlResult = "";
         public string Title = "";
     }

     [Serializable]
     [AjaxPro.AjaxNoTypeUsage]
     public class Evt
     {
         public long EvtId;

         public double AbsX;

         public double AbsY;

         public string Title;

         public int DistId;
         public int StreetId;
         public int CmnId;

         //public int Status = 0;

         //public int FirstAttachType = -1;

         //public string PicGUID;

         //public string Html;
     }

 }

NPOI分层导出的更多相关文章

  1. c# .Net :Excel NPOI导入导出操作教程之读取Excel文件信息及输出

    c# .Net :Excel NPOI导入导出操作教程之读取Excel文件信息及输出 using NPOI.HSSF.UserModel;using NPOI.SS.UserModel;using S ...

  2. NPOI导入导出EXCEL通用类,供参考,可直接使用在WinForm项目中

    以下是NPOI导入导出EXCEL通用类,是在别人的代码上进行优化的,兼容xls与xlsx文件格式,供参考,可直接使用在WinForm项目中,由于XSSFWorkbook类型的Write方法限制,Wri ...

  3. PhotoshopCS4轻松将PSD分层导出为Png分层

    大家在网上都下载过PSD分层素材,有时候想把素材分层导出,以往做法是一层一层导出,可是这样效率太低,其实利用PS自带功能可以轻松导出PNG分层.     我们先打开一个PSD文件. 文件有7个图层,分 ...

  4. NPOI导入导出Excel

    .net mvc利用NPOI导入导出excel 注意:如何导出的提交方式ajax导出是失效的! 解决方案是:js处理l两个表单的提交  代码:  第一步. 在页面里面加入2个隐藏的iframe, 如下 ...

  5. 简单回顾NPOI导入导出excel文件

    当前环境.net4.0 去官方下下载:  NOPI官网 关于NOPI的详细,这里就不再介绍. 在项目中,我们只需引入  NPOI.dll  就可以了. 接下来..................... ...

  6. c# .Net :Excel NPOI导入导出操作教程之List集合的数据写到一个Excel文件并导出

    将List集合的数据写到一个Excel文件并导出示例: using NPOI.HSSF.UserModel;using NPOI.SS.UserModel;using System;using Sys ...

  7. Npoi导入导出Excel操作

    之前公司的一个物流商系统需要实现对订单的批量导入和导出,翻阅了一些资料,最后考虑使用NPOI实现这个需求. 在winform上面实现excel操作:http://www.cnblogs.com/Cal ...

  8. .net mvc利用NPOI导入导出excel

    1.导出Excel :首先引用NPOI包(Action一定要用FileResult) /// <summary> /// 批量导出需要导出的列表 /// </summary> ...

  9. MVC NPOI Linq导出Excel通用类

    之前写了一个模型导出Excel通用类,但是在实际应用中,可能不是直接导出模型,而是通过Linq查询后获取到最终结果再导出 通用类: public enum DataTypeEnum { Int = , ...

随机推荐

  1. 1Z0-053 争议题目解析684

    1Z0-053 争议题目解析684 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 684.Your database is running in ARCHIVELOG mode. ...

  2. 如何保存微信的小视频 How to keep WeChat &#39;Sights&#39;

    微信小视频非常方便,但很难将其下载到本地电脑长期保存.网上有介绍方法,如百度经验上办法,但目前看来它可能只适用安卓系统,而且或已失效(可能由于版本更新).对Windows Phone无效,而对于更加封 ...

  3. Contributing to the C++ Core Guidelines

    Contributing to the C++ Core Guidelines "Within C++ is a smaller, simpler, safer language strug ...

  4. input type=&quot;number&quot;

    情景: 移动端 input控件,调数字键盘,在输入小数点时光标会自动跳到小数点前面.安卓6.0.1的版本会这样. question: 1.调原生数字键盘的方法,必须用 type="numbe ...

  5. Spike Notes on Theory of (Software) Transactional Memory[Doing]

    Motivation 程序员是否需要在处理一致性问题或者同步时,一定要make hands dirty?能不能专注于应用级原子性,而无需考虑低层操作系统.运行时支持的原子性概念或者语言构造? 软件事务 ...

  6. tornado + supervisor + nginx 的一点记录

    看了比较多的blog基本都是这个架构: supervisor ------------ app1 |-------app2 |-------.... |-------appn |-------ngin ...

  7. 10 个学习iOS开发的最佳网站(转)

    10 个学习iOS开发的最佳网站 作者 jopen 2012-09-26 08:59:56 1) Apple Learning Objective C Objective-C,通常写作ObjC和较少用 ...

  8. 基于MVC4+EasyUI的Web开发框架形成之旅--总体介绍

    最近花了很多时间在重构和进一步提炼Winform开发框架的工作上,加上时不时有一些项目的开发工作,我博客里面介绍Web开发框架的文章比较少,其实以前在单位工作,80%的时间是做Web开发的,很早就形成 ...

  9. 深入理解java虚拟机【Java虚拟机垃圾收集器】

    Java堆内存被划分为新生代和年老代两部分,新生代主要使用复制和标记-清除垃圾回收算法,年老代主要使用标记-整理垃圾回收算法,因此java虚拟中针对新生代和年老代分别提供了多种不同的垃圾收集器,JDK ...

  10. gridView--GridView关于间距的属性值介绍

    android:columnWidth  设置列的宽度.关联的方法为:setColumnWidth(int) android:gravity  设置此组件中的内容在组件中的位置.可选的值有:top.b ...