This project has moved and is read-only. For the latest updates, please go here.

Wrong Library Version?

May 29, 2012 at 10:01 PM
Edited May 29, 2012 at 10:36 PM

Hi,

I tried to apply this example in  Visual studio2008 C#:
http://epplus.codeplex.com/discussions/258920 

 

    using (ExcelPackage pck = new ExcelPackage())
            {
                foreach (DataTable tbl in dataSet.Tables)
                {
                    ExcelWorksheet ws = pck.Workbook.Worksheets.Add(tbl.TableName);
                    ws.Cells["A1"].LoadFromDataTable(tbl, true);
                }

                HttpResponse Response = System.Web.HttpContext.Current.Response;
                pck.SaveAs(Response.OutputStream);
                Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
                Response.AddHeader("content-disposition", "attachment;  filename=Sample1.xlsx");
            }

 

But i get an error on the constructor of ExcelPackage:
Cannot resolve constructor 'ExcelPackage' candidates are:
ExcelPackage(System.IO.FileInfo) (in class ExcelPackage)
ExcelPackage(System.IO.FileInfo, System.IO.FileInfo) (in class ExcelPackage)

Also the object ExcelWorkSheet does not have the method 'SaveAs' only 'Save', I have referenced this dll on my project:

EPPlus 3.0.0.2

namespace:

using OfficeOpenXml;

Please take me out of my ignorance and excuse my english.


Thanks in advance. 

May 30, 2012 at 12:52 AM

I just downloaded EPPlus 3.0.

Reference to it and now it works.

Thank you very much for your hard work on this library.