public static byte[] Export(IDataExportPortal portal, ExportParams parameters, IDataExportProvider provider) { int totalCount; IDictionary<string, String> dict = null; //获取参数的索引及名称 if (parameters != null && parameters.ExportFields != null) { dict = portal.GetExportFieldAndName(parameters.ExportFields); } return provider.Export( portal.GetShemalAndData(parameters == null ? null : parameters.Parameters, out totalCount), dict); }
public static byte[] Export(IDataExportPortal portal, ExportParams parameters, IDataExportProvider provider) { int totalCount; IDictionary <string, String> dict = null; //获取参数的索引及名称 if (parameters != null && parameters.ExportFields != null) { dict = portal.GetExportFieldAndName(parameters.ExportFields); } return (provider.Export( portal.GetShemalAndData(parameters == null ? null : parameters.Parameters, out totalCount), dict)); }
public static string GetExportData(HttpContext context) { IDataExportPortal portal = ExportItemManager.GetPortal(context.Request.QueryString["portal"]); ExportParams parameter = DataExportDirector.GetExportParams( context.Request["params"], null); int pageIndex, pageSize; if (context.Request["page"] != null) { int.TryParse(context.Request["page"], out pageIndex); parameter.Parameters.Add("pageIndex", pageIndex); } if (context.Request["rows"] != null) { int.TryParse(context.Request["rows"], out pageSize); parameter.Parameters.Add("pageSize", pageSize); } int totalCount; DataTable dt = portal.GetShemalAndData(parameter.Parameters, out totalCount); return(JsonConvert.SerializeObject(new { total = totalCount, rows = dt })); }
public JsonResult GetExportData() { IDataExportPortal portal = ExportHelper.GetPortal(this.Request["portal"], this.Request["params"], null); return(new U1Json(portal.GetShemalAndData())); }