protected override void ExportToExcel() { var path = HttpContext.Current.Request.Url.AbsolutePath; path = Path.GetFileNameWithoutExtension(path) + ".xlsx"; var builder = new GridToExcelBuilder(path, Usuario.ExcelFolder); var list = GetExcelItemList(); if (list.Count > 5000) { ShowInfo(CultureManager.GetLabel("EXCEL_DEMASIADOS_MENSAJES")); return; } builder.GenerateHeader(CultureManager.GetMenu(VariableName), GetFilterValues()); builder.AddExcelItemList(list); var results = GetMixedReportResults(); builder.GenerateColumns(results); builder.GenerateFields(results); SetExcelSessionVars(builder.CloseAndSave()); OpenWin(String.Concat(ApplicationPath, "Common/exportExcel.aspx"), CultureManager.GetSystemMessage("EXPORT_CSV_DATA")); }
protected virtual void SendReportToMail() { var path = HttpContext.Current.Request.Url.AbsolutePath; path = Path.GetFileNameWithoutExtension(path) + ".xlsx"; var builder = new GridToExcelBuilder(path, Usuario.ExcelFolder); var list = GridUtils.Search(Data, SearchString); builder.GenerateHeader(CultureManager.GetMenu(VariableName), new Dictionary <string, string>()); builder.GenerateColumns(list); builder.GenerateFields(list); SetExcelSessionVars(builder.CloseAndSave()); OpenWin(String.Concat(ApplicationPath, "Common/exportExcel.aspx"), CultureManager.GetSystemMessage("EXPORT_CSV_DATA")); }
protected override void ExportToExcel() { var path = HttpContext.Current.Request.Url.AbsolutePath; path = Path.GetFileNameWithoutExtension(path) + ".xlsx"; var builder = new GridToExcelBuilder(path, Usuario.ExcelFolder); var distribuciones = GetDistribuciones(new[] { -1 }); var controladas = distribuciones.Where(d => d.Controlado).Select(d => new ViajeDistribucionVo(d)).ToList(); var list = controladas.Select(c => new ControlDistribucionVo(c)).ToList(); builder.GenerateHeader(CultureManager.GetMenu(VariableName), GetFilterValues()); builder.GenerateColumns(list); builder.GenerateFields(list); Session["TMP_FILE_NAME"] = builder.CloseAndSave(); Session["CSV_FILE_NAME"] = CultureManager.GetMenu(Module.Name); OpenWin(String.Concat(ApplicationPath, "Common/exportExcel.aspx"), CultureManager.GetSystemMessage("EXPORT_CSV_DATA")); }
protected override void ExportToExcel() { Logger.Debug("ExportToExcel start"); var path = HttpContext.Current.Request.Url.AbsolutePath; path = Path.GetFileNameWithoutExtension(path) + ".xlsx"; var builder = new GridToExcelBuilder(path, Usuario.ExcelFolder); var list = GridUtils.Search(Data, SearchString); Logger.Debug("ExportToExcel builder.GenerateHeader"); if (list.Count > 5000) { ShowInfo(CultureManager.GetLabel("EXCEL_DEMASIADOS_MENSAJES")); return; } if (list.Count == 50) { ShowInfo(CultureManager.GetLabel("EXCEL_DEMASIADOS_MENSAJES")); return; } builder.GenerateHeader(CultureManager.GetMenu(VariableName), GetFilterValues()); Logger.Debug("ExportToExcel builder.GenerateColumns"); builder.GenerateColumns(list); Logger.Debug("ExportToExcel builder.GenerateFields"); // Hay que mejorar este GenerateFields builder.GenerateFields(list, CustomExportFormat); Logger.Debug("ExportToExcel SetExcelSessionVars"); SetExcelSessionVars(builder.CloseAndSave()); OpenWin(String.Concat(ApplicationPath, "Common/exportExcel.aspx"), CultureManager.GetSystemMessage("EXPORT_CSV_DATA")); Logger.Debug("ExportToExcel end"); }