none
export data to Excel sheet RRS feed

  • Question

  •  

    Hi,

    We have a requirment to export data to predefined excel sheet.  How can i do this.  The format of excel sheet is already given, i want to add record in that.  This is windows based application using C#2.0.  How i will implement this. 

     

    Excel Format like:

                                               Company Name

    Date:            MM/DD/YYYY

    User Name:  Selvakumar

     

    Cell1                         Cell2                                    Cell3                             Cell4                    Cell5

     1                               A                                        B                                   C                        D

     2                               G                                        H                                   I                         J

     

    The format is same in all case, only cell data is changing.  How can I implement this task.  How can i create copy of the template excel sheet and write values in particular cell.

     

    Selvakumar R

     

    Friday, April 11, 2008 6:39 AM

Answers

  • I would recommend ExcelPackage...   http://www.codeplex.com/ExcelPackage/Wiki/View.aspx?title=Using%20a%20template%20to%20create%20an%20Excel%20spreadsheet&referringTitle=Home
    Friday, April 11, 2008 9:43 AM

All replies

  • I would recommend ExcelPackage...   http://www.codeplex.com/ExcelPackage/Wiki/View.aspx?title=Using%20a%20template%20to%20create%20an%20Excel%20spreadsheet&referringTitle=Home
    Friday, April 11, 2008 9:43 AM
  • Thanks for your information. 

    Can you tell me from where we will get "OfficeOpenXml" reference.  Please tell me the location from where I will download "OfficeOpenXml".  I am using Visual studio 2005, whether this tool will support VS 2005.

    Thanks in advance.

     

    Regards,

    Selvakumar R

    Tuesday, April 15, 2008 8:50 AM
  • You could download the library (dll) from here: http://www.codeplex.com/ExcelPackage/Release/ProjectReleases.aspx?ReleaseId=1456  (ExcelPackageBinary.zip)

    Or you could download the source package and build it yourself.


    Now that you have the library it is only a matter of adding it to your project, which can be done as following:

    To add a reference in Visual C# or Visual J#

    1. In Solution Explorer, right-click on the project node and click Add Reference.

    2. In the Add Reference dialog box, select the tab indicating the type of component you want to reference.

    3. Select the components you want to reference, then click OK.


    Wednesday, April 16, 2008 5:36 AM