Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it easy #636

Closed
Porkechebure opened this issue Oct 21, 2019 · 1 comment

Comments

@Porkechebure
Copy link

@Porkechebure Porkechebure commented Oct 21, 2019

package is utter shit.
Rewrite it from scratch

Sample:
using (SpreadsheetDocument sDoc = SpreadsheetDocument.Open(MyExcelStream, ReadOnly)) { WorkbookPart workbookPart = sDoc.WorkbookPart; IEnumerable<Sheet> sheets = sDoc.WorkbookPart.Workbook.GetFirstChild<Sheets>().Elements<Sheet>(); string relationshipId = sheets.First().Id.Value; WorksheetPart worksheetPart = (WorksheetPart)sDoc.WorkbookPart.GetPartById(relationshipId); Worksheet workSheet = worksheetPart.Worksheet; SheetData sheetData = workSheet.GetFirstChild<SheetData>(); IEnumerable<Row> rows = sheetData.Descendants<Row>();

This is trash. Bad kids.

Learn:

EPPLus example:

using (var p = new ExcelPackage()) { //A workbook must have at least on cell, so lets add one... var ws=p.Workbook.Worksheets.Add("MySheet"); //To set values in the spreadsheet use the Cells indexer. ws.Cells["A1"].Value = "This is cell A1"; //Save the new workbook. We haven't specified the filename so use the Save as method. p.SaveAs(new FileInfo(@"c:\workbooks\myworkbook.xlsx")); }

Clear and easy!!!!

Learn to program and rewrite this trash please.

@twsouthwick

This comment has been minimized.

Copy link
Collaborator

@twsouthwick twsouthwick commented Oct 22, 2019

@Porkechebure Please engage with respect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.