epplus

How can I turn background error checking off for the Excel app object in EPPlus?

女生的网名这么多〃 提交于 2021-01-29 04:45:19
问题 Using the unwieldy and ponderous but full-featured Excel Interop, background error checking can be toggled off like so: Excel.Application excelApp = new Excel.Application(); excelApp.ErrorCheckingOptions.BackgroundChecking = false; ...as shown here I am getting the green triangles indicating a bad number like so: ...which I want to turn off. These are just string vals that should not be flagged as bad or suspicious. So how can I turn background error checking off for the Excel app object, or

How to change data label position in EPPlus?

帅比萌擦擦* 提交于 2021-01-29 04:21:00
问题 So here is my successfully generated chart. However for some reason on this chart only it decides the date times should show up at the top of the chart instead of the bottom. Here is my code and what I've tried. Notice the text is neither bold nor is at showing where it should. I've also tried giving the chart a ton of area to work with and it still does this. Any help in the right direction would be greatly appreciated. ExcelChart paintDewChart = overview.Drawings.AddChart(w.Name + "Dew",

EPPlus - Create and validate digital signature

橙三吉。 提交于 2021-01-28 03:32:55
问题 is it possible to add a digital signature to an excel document with EPPlus and validate a digital signature of an existing excel document? 回答1: Maybe you can go with a detached signature. You can create a signature using the following code: X509Certificate2 certificate = new X509Certificate2(certPath, password); byte[] signature; using (RSA rsa = certificate.GetRSAPrivateKey()) { signature = rsa.SignData(data, HashAlgorithmName.SHA512, RSASignaturePadding.Pkcs1); } where data is a byte array

How To Set Cell Data Type

做~自己de王妃 提交于 2021-01-21 04:03:29
问题 I am trying to set data type of cell, but it seems that's impossible to do with EPPlus. If I place a number as value in cell, I get General data type in exported Excel file. If set NumberFormat of Cells, for example: workSheet.Cells[range].Style.Numberformat.Format = "mm/dd/yyyy hh:mm:ss"; Then I still will not get Date or Time. Exported Excel file will show cells as Custom data type. I can get General or Custom data types only. I want to set Cells' data type to Time, but I can't. The problem

How To Set Cell Data Type

浪子不回头ぞ 提交于 2021-01-21 04:01:27
问题 I am trying to set data type of cell, but it seems that's impossible to do with EPPlus. If I place a number as value in cell, I get General data type in exported Excel file. If set NumberFormat of Cells, for example: workSheet.Cells[range].Style.Numberformat.Format = "mm/dd/yyyy hh:mm:ss"; Then I still will not get Date or Time. Exported Excel file will show cells as Custom data type. I can get General or Custom data types only. I want to set Cells' data type to Time, but I can't. The problem

Is it possible to read the excel cell value with formula?

给你一囗甜甜゛ 提交于 2021-01-03 05:50:37
问题 In my following code, the value of c4 is coming out zero. C4 cell has formula SUM(C2:C3). Is EPPlus capable of reading cell with formula? Why is c4 being set to zero instead of 12. using (var package = new ExcelPackage(existingFile)) { ExcelWorkbook workBook = package.Workbook; var currentWorksheet = workBook.Worksheets.First(); currentWorksheet.Cells["C2"].Value = 5; currentWorksheet.Cells["C3"].Value = 7; var c4 = Convert.ToDouble(currentWorksheet.Cells["C4"].Value); //c4 is zero. why? }

Formula not calculating with EPPLUS

*爱你&永不变心* 提交于 2020-12-27 06:49:04
问题 I would like to transfer a Datatable to excel and calculate a sum. For this I'm using epplus. Here is my code: Sheet.Cells["A1"].LoadFromDataTable(dsExcel.Tables[0], true, TableStyles.Medium9); Sheet.Cells[Sheet.Dimension.Address].AutoFitColumns(); Sheet.View.FreezePanes(3, 3); int totalCols = Sheet.Dimension.End.Column; int letztezeile = Sheet.Dimension.End.Row; var range = Sheet.Cells[1, 1, 1, totalCols]; for (int i = 3; i < totalCols; i++) { if (range[1, i].Value.ToString().Contains(

Formula not calculating with EPPLUS

跟風遠走 提交于 2020-12-27 06:48:58
问题 I would like to transfer a Datatable to excel and calculate a sum. For this I'm using epplus. Here is my code: Sheet.Cells["A1"].LoadFromDataTable(dsExcel.Tables[0], true, TableStyles.Medium9); Sheet.Cells[Sheet.Dimension.Address].AutoFitColumns(); Sheet.View.FreezePanes(3, 3); int totalCols = Sheet.Dimension.End.Column; int letztezeile = Sheet.Dimension.End.Row; var range = Sheet.Cells[1, 1, 1, totalCols]; for (int i = 3; i < totalCols; i++) { if (range[1, i].Value.ToString().Contains(

Formula not calculating with EPPLUS

喜欢而已 提交于 2020-12-27 06:48:33
问题 I would like to transfer a Datatable to excel and calculate a sum. For this I'm using epplus. Here is my code: Sheet.Cells["A1"].LoadFromDataTable(dsExcel.Tables[0], true, TableStyles.Medium9); Sheet.Cells[Sheet.Dimension.Address].AutoFitColumns(); Sheet.View.FreezePanes(3, 3); int totalCols = Sheet.Dimension.End.Column; int letztezeile = Sheet.Dimension.End.Row; var range = Sheet.Cells[1, 1, 1, totalCols]; for (int i = 3; i < totalCols; i++) { if (range[1, i].Value.ToString().Contains(

ASP.NET Core使用EPPlus导入导出Excel

别等时光非礼了梦想. 提交于 2020-12-12 00:44:38
开发过程中,经常会遇到导入导出数据的需求,本篇博客介绍在.NET Core中如何使用EPPlus组件导入导出Excel EPPlus: EPPlus是使用Open Office XML格式(xlsx)读写Excel 2007/2010文件的 .net 开发库,能读写Excel 2007/2010文件,可以运行在Windows, Linux和Mac,官网地址: https://archive.codeplex.com/ 在.net core中还可以使用NOPI操作Excel,在此不做介绍。 使用EPPlus操作Excel: 1、引入EPPlus包 ,在程序包管理控制台中执行命令安装依赖包: 1 PM> Install-Package EPPlus.Core -Version 1.5 . 4 2、导出Excel ①使用EF Core操作数据库时,数据源用List集合方便导出。 ②在控制器的构造函数中注入 IHostingEnvironment 来获取网站根目录路径,以便设置导出Excel文件路径。 1 public IActionResult OutputExcel( ) 2 { 3 // 数据源为list集合 4 var query = ( from u in _context.UserInfo 5 select new 6 { 7 u.UId, 8 u.UName, 9 u