Export to excel

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cdude

    Export to excel

    I need to export into excel but not into a new worksheet each time.I
    want to add the exported dataset onto an existing spreadsheet that
    already has rows on it. I may have not written this to well. Please
    any suggestions. Thanks
  • Marcin Hoppe

    #2
    Re: Export to excel

    Cdude pisze:
    I need to export into excel but not into a new worksheet each time.I
    want to add the exported dataset onto an existing spreadsheet that
    already has rows on it. I may have not written this to well. Please
    any suggestions. Thanks
    The general idea is to use OLE DB provider with Microsoft Jet engine
    which is capable of performing some SQL statements on Excel workbooks.
    To make a long story short: first you must create a "table" in Excel
    with CREATE TABLE statement (it will create a worksheet) and then you
    can use regular INSERT statements to add new rows to the table, which
    effectively will add rows to existing worksheet.

    This article should help:



    --
    Marcin Hoppe
    Email: marcin.hoppe@gm ail.com
    Blog: http://devlicio.us/blogs/marcin_hoppe

    Comment

    • Mark Rae [MVP]

      #3
      Re: Export to excel

      "Cdude" <cameljs18@yaho o.comwrote in message
      news:f0e07e1d-c43c-49d1-a077-2f679012fa03@a2 3g2000hsc.googl egroups.com...
      I need to export into excel but not into a new worksheet each time.I
      want to add the exported dataset onto an existing spreadsheet that
      already has rows on it. I may have not written this to well. Please
      any suggestions. Thanks
      Marcin's reply will work well if you need to add only basic data to the
      existing Excel spreadsheet. However, if you need anything more than this
      (e.g. formatting, formulas etc), then you could use Office Automation via
      COM / Interop. However, this would require a copy of Excel installed on the
      same machine as your C# app.

      Alternatively, this will do what you require without a copy of Excel:
      Create Excel file manipulation applications using High Code or Low Code APIs or No Code Apps to view compare inspect or convert Excel files.



      --
      Mark Rae
      ASP.NET MVP


      Comment

      • mario.ivic2@gmail.com

        #4
        Re: Export to excel

        On May 5, 8:55 am, Cdude <camelj...@yaho o.comwrote:
        I need to export into excel but not into a new worksheet each time.I
        want to add the exported dataset onto an existing spreadsheet that
        already has rows on it. I may have not written this to well. Please
        any suggestions. Thanks
        Probably the best way to do it is to use some of the third party
        component. I can recommend you GemBox.Spreadsh eet .NET component. You
        can find an example of exporting to dataset at: http://www.gemboxsoftware.com/LDataSet.htm.

        --
        Mario
        GemBox.Spreadsh eet for .NET - Easily read and write Excel (XLS, XLSX
        or CSV) files or export to HTML files from your .NET apps. See

        Comment

        Working...