epplus

How to use Epplus with cells containing few rows

拟墨画扇 提交于 2019-12-07 21:24:50
问题 I want to import some excel file using epplus the problem is that some cells contains more than one row (and that cause a problem My excel look like this (in realite their is more tests (test2,test3....) I can only get the first column by this algorithm..but it will be more complicated to get the seconde column //this is the list than contain applications (column 2) ICollection<Application> applications = new List<Application>(); int i = 0; for (int j = workSheet.Dimension.Start.Row; j <=

epplus charts without gridlines in c# ( Its a web Application)

允我心安 提交于 2019-12-07 14:52:42
问题 Graph Without GridLinesI am trying to create a chart in excel file using epplus and c#. I am able to create graph , I am trying to remove the gridlines in graph as shown in the images . I found solution to do it in windows application , but i wanted to do it in web application , below is the code i use to generate graph. ExcelRange erLossesRangeMacInv = worksheet.Cells["G5:G10"]; var chartOEE=(ExcelBarChart)worksheetGraph.Drawings.AddChart("barChartOEE", eChartType.ColumnClustered); chartOEE

Can I download an Excel file made from a memory stream off an ASP.NET page?

让人想犯罪 __ 提交于 2019-12-07 13:53:10
问题 I have an ASP.NET page where a user provides an ID, and then we pull some data from the DB and put it into an Excel spreadsheet. I would like to create the Excel file in memory and then allow the user to download the file. I could create a file on the server, and then delete it afterwards, but it seems unnecessary. Depending on error handling I could potentially orphan a file with that approach, etc. Is something like this possible? Or do I need to use a file stream? On a side note, I'm using

Access Protected Excel File with ExcelDataReader and Epplus

安稳与你 提交于 2019-12-07 08:56:54
问题 title pretty much says it all. Looking for a way to access a password protected excel file with ExcelDataReader and Epplus, can't find a proper answer. If using ExcelDataReader, my code looks like excelStream = File.Open(excelFilePath, FileMode.Open, FileAccess.Read); excelReader = ExcelReaderFactory.CreateOpenXmlReader(excelStream); excelDataSet = excelReader.AsDataSet(); If using EPPlus my connection code looks like excelPackage = new ExcelPackage(new FileInfo(excelFilePath)); excelWorkbook

Can EPPlus distinguish between blank cells and empty text cells in an Excel worksheet?

☆樱花仙子☆ 提交于 2019-12-07 07:25:11
问题 I'm using the EPPlus .NET library (v4.0.4) to interpret saved Excel workbooks. In one such worksheet, some empty cells have been set to 'text' format using the Excel 'apostrophe' trick (that is, the user has entered a single apostrophe in those cells, so that Excel will display them as blank). Sample XML for two such cells is as follows: <c r="F6" s="1" t="inlineStr"> <is> <t /> </is> </c> <c r="G6" s="1" /> Here, F6 has an apostrophe (i.e. is an empty text cell) and G6 is genuinely blank. Is

(C#) Can I programmatically set an XLSX cell to a picture/image?

我的梦境 提交于 2019-12-07 06:51:59
问题 I am hoping to make spreadsheets that contain some pictures (embed pictures from files) and I started looking at EPPlus (looks like a great library) However it seems that the images are not tied to a cell - rather to an x,y, coordinate. Is there a way with EPPlus or other way to set a cell to a picture (and then manipulate the size of the cell?) SetPosition 回答1: You can insert the picture, then adjust its .Top and .Left so it aligns with the .Top and .Left of the appropriate cell. You can set

EPPlus - Do I need to call Dispose on objects like ExcelRange?

你离开我真会死。 提交于 2019-12-07 06:36:36
问题 I'm using the C# EPPlus library to create Excel documents. ExcelWorksheet ws = pkg.Workbook.Worksheets.Add("Sheet1"); ws.Cells["E3"].Value = "Foo"; ws.Cells["F3"].Value = "Bar"; ws.Cells["F3"].Style.Font.Bold = true; The ws.Cells[] return type is ExcelRange which has a Dispose() method. Do I need to call it each time I use ws.Cells[] ? Something like ExcelWorksheet ws = pkg.Workbook.Worksheets.Add("Sheet1"); ExcelRange rng; rng = ws.Cells["E3"]; rng.Value = "Foo"; rng.Dispose(); using (rng =

Selecting grouped max and min in a Epplus worksheet with Linq

时间秒杀一切 提交于 2019-12-06 16:19:42
I have an Epplus Excel Worksheet that looks like this. I want to group by the Group column (in column A), and then select the max and the min. Something in my group by clause isn't quite right and I'm getting an error: Cannot apply indexing with [] to ExcelRangeBase . var maxMinGrouped = from cells in _dataSheet.Cells["A:H"] group cells by cells["A:A"].Value into g //pull "Group" column into group select new { Group = cells["A:A"].Value, MaxDailyIndex = g.Max(c => c.Value), MinDailyIndex = g.Min(c => c.Value) }; The SQL I'm trying to achieve. SELECT Group ,MAX(Col_E) AS MaxDailyIndex ,MIN(Col

How can I delete a Column of XLSX file with EPPlus in web app

不羁的心 提交于 2019-12-06 15:58:07
How can I delete a column of a .XLSX file with EPPlus in a web application? I use EPplus for generating Excel reports and a stored procedure to get the data from database. The problem is that I want to remove one of the columns of information in the report file by EPplus (stored procedure should not be changed.) I would remove the additional column in and also want to change the page layout direction to (right to left), but it does not work '----/// Click Report Button ///---- Protected Sub btnExcel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExcel.Click If

Opening a client-side Excel file using EPPlus

末鹿安然 提交于 2019-12-06 13:01:45
问题 I am the middle of writing a program which has to create an excel file on a client machine and then, after they have saved and updated it then I need to import it again and apply the changes to my database. The export bit of it works fine, however when I import from the web application I get zero worksheets in my workbook. If I run it on my development machine, i.e. the website is running on the same machine as the file is located then it works fine. My code is as follows: try { Productsfile