다운로드 엑셀 부분 수정 및

온라인 삭제, 혼합 -> 온라인교육으로 전환
This commit is contained in:
kdh0120 2021-05-31 04:47:40 +00:00
parent 07c05e5246
commit 802a278457
13 changed files with 98371 additions and 8 deletions

Binary file not shown.

View File

@ -994,11 +994,11 @@ namespace NP.BO.Controllers
new String[] { "구분","과정분류","교육유형","이름","주민번호","기술인분류","교육구분","교육목적","등급","직무분야","과정명","수료번호","업체명","업체주소","사업자등록번호", new String[] { "구분","과정분류","교육유형","이름","주민번호","기술인분류","교육구분","교육목적","등급","직무분야","과정명","수료번호","업체명","업체주소","사업자등록번호",
"고용보험관리번호","업태","종목","대표자","교육시작일","교육종료일","교육이수시간","소속협회","학력","직위","교육생연락처","업체담당자","업체담당당자 연락처","교육비", "고용보험관리번호","업태","종목","대표자","교육시작일","교육종료일","교육이수시간","소속협회","학력","직위","교육생연락처","업체담당자","업체담당당자 연락처","교육비",
"환급액","환급은행명","환급계좌" ,"환급계좌예금주","계산서이메일","교육연도"}, "환급액","환급은행명","환급계좌" ,"환급계좌예금주","계산서이메일","교육연도"},
new String[] { "kind", "cg", "cshape", "username", "userpno", "typeman", "edukind", "typeedu", "typegrade", "typejob", "cgname", "completeno", "companyname", new String[] { "kind", "cg", "cshape", "username", "userpnostr", "typeman", "edukind", "typeedu", "typegrade", "typejob", "cgname", "completeno", "companyname",
"companyaddr", "brno", "eino", "btype", "bkind", "ceoname", "ssdateymd","sedateymd","sctime","assign","slevel","uduty","phone","mname","mphone", "companyaddr", "brno", "eino", "btype", "bkind", "ceoname", "ssdateymd2","sedateymd2","sctime","assign","slevel","uduty","phone","mname","mphone",
"sprice","rprice","rbank","rbankno","rbankuser","taxemail","syear"}, "sprice","rprice","rbank","rbankno","rbankuser","taxemail","syear"},
vm.DocumentList, vm.DocumentList,
"증빙서류출력(과거)"); "증빙서류출력(과거)",null,",0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,");
} }
return View(vm); return View(vm);
} }

View File

@ -101,7 +101,8 @@
} }
<div class="line line-dashed line-lg pull-in"></div><div class="form-group"> <div class="line line-dashed line-lg pull-in"></div><div class="form-group">
<label class="col-sm-4 col-md-2 control-label req">교육유형</label> <label class="col-sm-4 col-md-2 control-label req">교육유형</label>
<div class="col-sm-8 col-md-10">@Html.Partial("./Partial/Radio", Model.CM.cshape, new ViewDataDictionary() { { "valuetext", "0:온라인;1:교육장;2:온라인 혼합" }, { "checked", Model.CM.cshape }, { "name", "CM.cshape" } })</div> @*<div class="col-sm-8 col-md-10">@Html.Partial("./Partial/Radio", Model.CM.cshape, new ViewDataDictionary() { { "valuetext", "0:온라인;1:교육장;2:온라인 혼합" }, { "checked", Model.CM.cshape }, { "name", "CM.cshape" } })</div>*@
<div class="col-sm-8 col-md-10">@Html.Partial("./Partial/Radio", Model.CM.cshape, new ViewDataDictionary() { { "valuetext", "1:교육장 교육;2:온라인 교육" }, { "checked", Model.CM.cshape }, { "name", "CM.cshape" } })</div>
</div> </div>
<div class="line line-dashed line-lg pull-in isaccommodation"></div><div class="form-group isaccommodation" style="display:none"> <div class="line line-dashed line-lg pull-in isaccommodation"></div><div class="form-group isaccommodation" style="display:none">
<label class="col-sm-4 col-md-2 control-label req">합숙여부</label> <label class="col-sm-4 col-md-2 control-label req">합숙여부</label>

View File

@ -37,6 +37,9 @@
<Reference Include="Common.Logging.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL"> <Reference Include="Common.Logging.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
<HintPath>..\packages\Common.Logging.Core.3.0.0\lib\net40\Common.Logging.Core.dll</HintPath> <HintPath>..\packages\Common.Logging.Core.3.0.0\lib\net40\Common.Logging.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="EPPlus">
<HintPath>..\packages\EPPlus.4.5.3.1\lib\net40\EPPlus.dll</HintPath>
</Reference>
<Reference Include="Excel, Version=2.1.2.3, Culture=neutral, PublicKeyToken=93517dbe6a4012fa, processorArchitecture=MSIL"> <Reference Include="Excel, Version=2.1.2.3, Culture=neutral, PublicKeyToken=93517dbe6a4012fa, processorArchitecture=MSIL">
<HintPath>..\packages\ExcelDataReader.2.1.2.3\lib\net45\Excel.dll</HintPath> <HintPath>..\packages\ExcelDataReader.2.1.2.3\lib\net45\Excel.dll</HintPath>
</Reference> </Reference>

View File

@ -12,6 +12,7 @@ using System.Web.Mail;
using System.Web.Compilation; using System.Web.Compilation;
using NP.Model; using NP.Model;
using System.Net.Http; using System.Net.Http;
using OfficeOpenXml;
namespace NP.Base namespace NP.Base
{ {
@ -783,14 +784,16 @@ namespace NP.Base
/// 해당 컨트롤러에서 View를 ExportExcel로 리턴 /// 해당 컨트롤러에서 View를 ExportExcel로 리턴
/// List<CodeMode> test=new List<CodeMode>(); /// List<CodeMode> test=new List<CodeMode>();
/// test.add(new CodeModel(){PageTitle="test1",PageNum=1}); /// test.add(new CodeModel(){PageTitle="test1",PageNum=1});
/// ex: return ExportExcel(new string[]{"타이틀","번호"},new string[]{"PageTitle","PageNum"},test,"test"); /// ex: return ExportExcel(new string[]{"타이틀","번호"},new string[]{"PageTitle","PageNum"},test,"test", null, ",2,3,");
/// </summary> /// </summary>
/// <param name="paramHeaders">헤더</param> /// <param name="paramHeaders">헤더</param>
/// <param name="paramColumns">컬럼명 </param> /// <param name="paramColumns">컬럼명 </param>
/// <param name="paramObj">데이터 List</param> /// <param name="paramObj">데이터 List</param>
/// <param name="paramFileNameNoExt">파일명(확장자없이)</param> /// <param name="paramFileNameNoExt">파일명(확장자없이)</param>
/// <param name="_dt"/>엑셀로다운받을 datatable object </param>
/// <param name="textcolumns"/>엑셀다운로드시, text형식으로 받을 cellindex지정</param>
/// <returns></returns> /// <returns></returns>
public ActionResult ExportExcel(string[] paramHeaders, string[] paramColumns, System.Collections.IEnumerable paramObj, string paramFileNameNoExt, System.Data.DataTable _dt = null) public ActionResult ExportExcel(string[] paramHeaders, string[] paramColumns, System.Collections.IEnumerable paramObj, string paramFileNameNoExt, System.Data.DataTable _dt = null, string textcolumns = null)
{ {
var dataGrid = new System.Web.UI.WebControls.DataGrid(); var dataGrid = new System.Web.UI.WebControls.DataGrid();
var dataTable = new System.Data.DataTable(paramFileNameNoExt); var dataTable = new System.Data.DataTable(paramFileNameNoExt);
@ -819,6 +822,8 @@ namespace NP.Base
{ {
dataTable = _dt; dataTable = _dt;
} }
//@CUSTOM@ : 엑셀컬럼에 text형식으로 받을 columnindex String 지정
deidbtextcolumns = textcolumns;
dataGrid.ItemDataBound += new System.Web.UI.WebControls.DataGridItemEventHandler(DataExportExcel_ItemDataBound); dataGrid.ItemDataBound += new System.Web.UI.WebControls.DataGridItemEventHandler(DataExportExcel_ItemDataBound);
dataGrid.DataSource = dataTable; dataGrid.DataSource = dataTable;
dataGrid.DataBind(); dataGrid.DataBind();
@ -828,7 +833,8 @@ namespace NP.Base
System.Text.StringBuilder sbResponseString = new System.Text.StringBuilder(); System.Text.StringBuilder sbResponseString = new System.Text.StringBuilder();
sbResponseString.Append("<html xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns=\"http://www.w3.org/TR/REC-html40\">"); sbResponseString.Append("<html xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns=\"http://www.w3.org/TR/REC-html40\">");
sbResponseString.Append("<head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>Sheet1</x:Name><x:WorksheetOptions><x:Panes></x:Panes></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head> <body>"); //@CUSTOM@ : text형식 style 지정 => mso-number-format:\@;
sbResponseString.Append("<head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>Sheet1</x:Name><x:WorksheetOptions><x:Panes></x:Panes></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]-->" + (@"<style> .text { mso-number-format:\@; } </style>") + "</head> <body>");
sbResponseString.Append(sw.ToString() + "</body></html>"); sbResponseString.Append(sw.ToString() + "</body></html>");
Response.Clear(); Response.Clear();
@ -842,6 +848,23 @@ namespace NP.Base
System.Web.HttpContext.Current.ApplicationInstance.CompleteRequest(); System.Web.HttpContext.Current.ApplicationInstance.CompleteRequest();
return null; return null;
} }
//@CUSTOM@ : text형식 style 지정속성
private string deidbtextcolumns { get; set; }
public void ExportExcelXLSX<T>(List<T> data, String fname)
{
ExcelPackage excel = new ExcelPackage();
var workSheet = excel.Workbook.Worksheets.Add("Sheet1");
workSheet.Cells[1, 1].LoadFromCollection(data, true);
using (var memoryStream = new System.IO.MemoryStream())
{
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
Response.AddHeader("content-disposition", "attachment; filename=" + fname + ".xlsx");
excel.SaveAs(memoryStream);
memoryStream.WriteTo(Response.OutputStream);
Response.Flush();
Response.End();
}
}
private void DataExportExcel_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) private void DataExportExcel_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{ {
if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Header) if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Header)
@ -867,6 +890,11 @@ namespace NP.Base
{ {
//Any Cell specific formatting should be done here //Any Cell specific formatting should be done here
e.Item.Cells[cellIndex].HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Left; e.Item.Cells[cellIndex].HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Left;
// @CUSTOM@ : text형식 style 지정
if (!string.IsNullOrEmpty(deidbtextcolumns) && deidbtextcolumns.Contains("," + cellIndex + ","))
{
e.Item.Cells[cellIndex].Attributes.Add("class", "text");
}
cellIndex++; cellIndex++;
} }
} }

View File

@ -282,7 +282,7 @@ namespace NP.Model
{ {
get get
{ {
return cshape == 0 ? "온라인" : cshape == 1 ? "교육장" : cshape == 2 ? "온라인 혼합" : "-"; return cshape == 0 ? "온라인" : cshape == 1 ? "교육장 교육" : cshape == 2 ? "온라인 교육" : "-";
} }
} }
/// <summary> /// <summary>

View File

@ -47,6 +47,13 @@ namespace NP.Model
/// 주민번호 /// 주민번호
/// </summary> /// </summary>
public String userpno { get; set; } public String userpno { get; set; }
public String userpnostr
{
get
{
return userpno.Length > 7 ? userpno.Insert(6, "-") : userpno;
}
}
/// <summary> /// <summary>
/// 기술인분류 /// 기술인분류
/// </summary> /// </summary>
@ -114,6 +121,13 @@ namespace NP.Model
return ssdate != null ? ssdate.Value.ToString("yyyy-MM-dd") : null; return ssdate != null ? ssdate.Value.ToString("yyyy-MM-dd") : null;
} }
} }
public String ssdateymd2
{
get
{
return ssdate != null ? ssdate.Value.ToString("yyyyMMdd") : null;
}
}
/// <summary> /// <summary>
/// 교육시작일(엑셀매칭용) /// 교육시작일(엑셀매칭용)
/// </summary> /// </summary>
@ -129,6 +143,13 @@ namespace NP.Model
return sedate != null ? sedate.Value.ToString("yyyy-MM-dd") : null; return sedate != null ? sedate.Value.ToString("yyyy-MM-dd") : null;
} }
} }
public String sedateymd2
{
get
{
return sedate != null ? sedate.Value.ToString("yyyyMMdd") : null;
}
}
/// <summary> /// <summary>
/// 교육종료일(엑셀매칭용) /// 교육종료일(엑셀매칭용)
/// </summary> /// </summary>

BIN
packages/EPPlus.4.5.3.1/.signature.p7s vendored Normal file

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

199
packages/EPPlus.4.5.3.1/readme.txt vendored Normal file
View File

@ -0,0 +1,199 @@
EPPlus 4.5.3.1
New features in version 4.5:
* .NET Core support
* Sparklines
* Sort method added to ExcelRange
* Bug fixes and minor changes, see below and visit https://github.com/JanKallman/EPPlus for tutorials, samples and the latest information
Important Notes:
Breaking change in .NET Core: The Worksheets collection will be zero based as default.
This can be altered by setting the ExcelPackage.Compatibility.IsWorksheets1Based to true.
.NET Core will have this property set to false, and .Net 3.5 and .Net 4 version will have this property set to true for backward compatibility reasons.
This property can also be set via the appsettings.json file in .Net Core or the app.config file. See sample project for examples!
.NET Core uses a preview of System.Drawing.Common, so be aware of that. We will update it as Microsoft releases newer versions.
System.Drawing.Common requires libgdiplus to be installed on non-Windows operating systems.
Use your favorite package manager to install it.
For example:
Homebrew on MacOS:
brew install mono-libgdiplus
apt-get:
apt-get install libgdiplus
EPPlus-A .NET Spreadsheet API
Changes
4.5.3.1
* Fixed Lookup function ignoring result vector.
* Fixed address validation.
4.5.3
* Upgraded System.Drawing.Common for .NET Core to 4.5.1
* Enabled worksheetcharts to use a pivottable as source by adding a pivotTableSource parameter to the AddChart method of the Worksheets collection
* Pmt function
* And lots of bugfixes, see https://github.com/JanKallman/EPPlus/commits/master
4.5.2.1
* Upgraded System.Drawing.Common for .NET Core to 4.5.0
* Fixed problem with Apostrophe in worksheet name
4.5.2
* Upgraded System.Drawing.Common to 4.5.0-rc1
* Optimized image handling
* External Streams are not closed when disposing the package
* Fixed issue with Floor and Celing functions
* And more bugfixes, see https://github.com/JanKallman/EPPlus/commits/master
4.5.1
* Added web sample for .NET Core from Vahid Nasiri
* Added sample sparkline sample to sample project
* Fixed a few problems related to .NET Core on Mac
4.5.0.3
* Fix for compound documents (VBA and Encryption).
* Fix for Excel 2010 sha1 hashed agile encryption.
* Upgraded System.Drawing.Common to 4.5.0-preview1-26216-02
* Also see https://github.com/JanKallman/EPPlus/commits/master
4.5.0.2 rc
* Merge in e few pull requests and fixed a few issues. See https://github.com/JanKallman/EPPlus/commits/master
4.5.0.1 Beta 2
* Added sparkline support.
* Switched targetframework from netcoreapp2.0 to netstandardapp2.0
* Replaced CoreCompat.System.Drawing.v2 with System.Drawing.Common
* Fixed a few issues. See https://github.com/JanKallman/EPPlus/commits/master
4.5.0.0 Beta 1
* .Net Core support.
* Added ExcelPackage.Compatibility.IsWorksheets1Based to remove inconsistent 1 base collection on the worksheets collection.
Note: .Net Core will have this property set to false, and .Net 3.5 and .Net 4 version will have this property set to true for backward compatibility reasons.
This property can be set via the appsettings.json file in .Net Core or the app.config file. See sample project for examples.
* RoundedCorners property Add to ExcelChart
* DataTable propery Added to ExcelPlotArea for charts
* Sort method added on ExcelRange
* Added functions NETWORKDAYS.INTL and NETWORKDAYS.
* And a lot of bug fixes. See https://github.com/JanKallman/EPPlus/commits/master
4.1.1
* Fix VBA bug in Excel 2016 - 1708 and later
4.1
* Added functions Rank, Rank.eq, Rank.avg and Search
* Applied a whole bunch of pull requests...
* Performance and memory usage tweeks
* Ability to set and retrieve 'custom' extended application propeties.
* Added style QuotePrefix
* Added support for MajorTimeUnit and MinorTimeUnit to chart axes
* Added GapWidth Property to BarChart and Gapwidth.
* Added Fill and Border properties to ChartSerie.
* Added support for MajorTimeUnit and MinorTimeUnit to chart axes
* Insert/delete row/column now shifts named ranges, comments, tables and pivottables.
* And fixed a lot of issues. See http://epplus.codeplex.com/SourceControl/list/changesets for more details
4.0.5 Fixes
* Switched to Visual Studio 2015 for code and sample projects.
* Added LineColor, MarkerSize, LineWidth and MarkerLineColor properties to line charts
* Added LineEnd properties to shapes
* Added functions Value, DateValue, TimeValue
* Removed WPF depedency.
* And fixed a lot of issues. See http://epplus.codeplex.com/SourceControl/list/changesets for more details
4.0.4 Fixes
* Added functions Daverage, Dvar Dvarp, DMax, DMin DSum, DGet, DCount and DCountA
* Exposed the formula parser logging functionality via FormulaParserManager.
* And fixed a lot of issues. See http://epplus.codeplex.com/SourceControl/list/changesets for more details
4.0.3 Fixes
* Added compilation directive for MONO (Thanks Danny)
* Added functions IfError, Char, Error.Type, Degrees, Fixed, IsNonText, IfNa and SumIfs
* And fixed a lot of issues. See http://epplus.codeplex.com/SourceControl/list/changesets for more details
4.0.2 Fixes
* Fixes a whole bunch of bugs related to the cell store (Worksheet.InsertColumn, Worksheet.InsertRow, Worksheet.DeleteColumn, Worksheet.DeleteRow, Range.Copy, Range.Clear)
* Added functions Acos, Acosh, Asinh, Atanh, Atan, CountBlank, CountIfs, Mina, Offset, Median, Hyperlink, Rept
* Fix for reading Excel comment content from the t-element.
* Fix to make Range.LoadFromCollection work better with inheritence
* And alot of other small fixes
4.0.1 Fixes
* VBA unreadable content
* Fixed a few issues with InsertRow and DeleteRow
* Fixed bug in Average and AverageA
* Handling of Div/0 in functions
* Fixed VBA CodeModule error when copying a worksheet.
* Value decoding when reading str element for cell value.
* Better exception when accessing a worksheet out of range in the Excelworksheets indexer.
* Added Small and Large function to formula parser. Performance fix when encountering an unknown function.
* Fixed handling strings in formulas
* Calculate hangs if formula start with a parenthes.
* Worksheet.Dimension returned an invalid range in some cases.
* Rowheight was wrong in some cases.
* ExcelSeries.Header had an incorrect validation check.
New features 4.0
Replaced Packaging API with DotNetZip
* This will remove any problems with Isolated Storage and enable multithreading
New Cell store
* Less memory consumption
* Insert columns (not on the range level)
* Faster row inserts,
Formula Parser
* Calculates all formulas in a workbook, a worksheet or in a specified range
* 100+ functions implemented
* Access via Calculate methods on Workbook, Worksheet and Range objects.
* Add custom/missing Excel functions via Workbook. FormulaParserManager.
* Samples added to the EPPlusSamples project.
The formula parser does not support Array Formulas
* Intersect operator (Space)
* References to external workbooks
* And probably a whole lot of other stuff as well :)
Performance
*Of course the performance of the formula parser is nowhere near Excels. Our focus has been functionality.
Agile Encryption (Office 2012-)
* Support for newer type of encryption.
Minor new features
* Chart worksheets
* New Chart Types Bubblecharts
* Radar Charts
* Area Charts
* And lots of bug fixes...
Beta 2 Changes
* Fixed bug when using RepeatColumns & RepeatRows at the same time.
* VBA project will be left untouched if its not accessed.
* Fixed problem with strings on save.
* Added locks to the cell store for access by multiple threads.
* Implemented Indirect function
* Used DisplayNameAttribute to generate column headers from LoadFromCollection
* Rewrote ExcelRangeBase.Copy function.
* Added caching to Save ZipStream for Cells and shared strings to speed up the Save method.
* Added Missing InsertColumn and DeleteColumn
* Added pull request to support Date1904
* Added pull request ExcelWorksheet. LoadFromDataReader
Release Candidate changes
* Fixed some problems with Range.Copy Function
* InsertColumn and Delete column didn't work in some cases
* Chart.DisplayBlankAs had the wrong default type in Excel 2010+
* Datavalidation list overflow caused corruption of the package
* Fixed a few Calculation when referring ranges (for example If function)
* Added ChartAxis.DisplayUnit
* Fixed a bug related to shared formulas
* Named styles failed in some cases.
* Style.Indent got an invalid value in some cases.
* Fixed a problem with AutofitColumns method.
* Performance fix.
* A whole lot of other small fixes.