前端 - 增加匯出檔名+YYYYMMDD
This commit is contained in:
		
							parent
							
								
									7b3d9fa532
								
							
						
					
					
						commit
						6d7fe6c60e
					
				@ -562,7 +562,7 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
            ms.Flush();
 | 
					            ms.Flush();
 | 
				
			||||||
            ms.Seek(0, SeekOrigin.Begin);
 | 
					            ms.Seek(0, SeekOrigin.Begin);
 | 
				
			||||||
            Response.Headers.Add("Access-Control-Expose-Headers", "Content-Disposition");
 | 
					            Response.Headers.Add("Access-Control-Expose-Headers", "Content-Disposition");
 | 
				
			||||||
            return File(ms, "application/vnd.ms", "電表報表.xlsx");
 | 
					            return File(ms, "application/vnd.ms", @$"電表報表{System.DateTime.Now.ToString("yyyyMMddHHmm")}.xlsx");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [HttpPost]
 | 
					        [HttpPost]
 | 
				
			||||||
@ -796,7 +796,7 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
            ms.Flush();
 | 
					            ms.Flush();
 | 
				
			||||||
            ms.Seek(0, SeekOrigin.Begin);
 | 
					            ms.Seek(0, SeekOrigin.Begin);
 | 
				
			||||||
            Response.Headers.Add("Access-Control-Expose-Headers", "Content-Disposition");
 | 
					            Response.Headers.Add("Access-Control-Expose-Headers", "Content-Disposition");
 | 
				
			||||||
            return File(ms, "application/vnd.ms-excel", "電表報表.xlsx");
 | 
					            return File(ms, "application/vnd.ms-excel", @$"電表報表{System.DateTime.Now.ToString("yyyyMMddHHmm")}.xlsx");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public static int GetDayInMonth(string yearMonth)
 | 
					        public static int GetDayInMonth(string yearMonth)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user