GridView to Excel


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 12 of 12

Thread: GridView to Excel

  1. #1
    Join Date
    Sep 2004
    Posts
    56

    Question GridView to Excel

    Dear all

    Any body know / have some function to convert GridView to Excel, please sharing to me, I need this function immediately.

    TQ

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Assuming the GridView is being populated from a database table, why not just dump the database records to excel and avoid the middle man?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  3. #3
    Join Date
    Sep 2004
    Posts
    56
    Thanks for you response

    But ... my gridview populate from List.

  4. #4
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    List? What kind of list?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  5. #5
    Join Date
    Sep 2004
    Posts
    56
    List<DAL.Employee> lstEmployee = objEmplyee.List();

    in objEmployee.List i have select several tables that I joint, in Gridview I used unbound data, so i just set on DataPropertyName. That I want export all data in gridview.

  6. #6
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Quote Originally Posted by MGunawan View Post
    i have select several tables that I joint
    So, you are using database tables, right?

    Then just dump them directly to Excel.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  7. #7
    Join Date
    Mar 2004
    Posts
    102
    Quote Originally Posted by Hack View Post
    So, you are using database tables, right?

    Then just dump them directly to Excel.
    Hack,
    I'd appriciate if u share me the code sample for exporting gridview to excel.
    Sonia

  8. #8
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  9. #9
    Join Date
    Sep 2004
    Posts
    56
    For ASP.NET there is no problem, my problem in winform application. this make me little confused, so i make function to Convert GridView to CSV file not to XLS. ... and everything ok.

    Thanks for you help
    -goen-

  10. #10
    Join Date
    Mar 2004
    Posts
    102
    Quote Originally Posted by Hack View Post
    Thank you
    Sonia

  11. #11
    Join Date
    Dec 2008
    Posts
    1
    I used the solution given in http://aspalliance.com/771
    but it makes the use do save as *.XLS

    A better solution is the one in http://www.codeproject.com/KB/office...etToExcel.aspx

  12. #12
    Join Date
    Feb 2011
    Posts
    1

Similar Threads

  1. Replies: 12
    Last Post: 03-09-2010, 10:51 AM
  2. Replies: 0
    Last Post: 03-09-2006, 09:40 PM
  3. Exporting Gridview (ASP.NET 2.0) to Excel?
    By bjbenoit in forum .NET
    Replies: 1
    Last Post: 01-27-2006, 07:35 PM
  4. Replies: 8
    Last Post: 01-23-2006, 04:27 PM
  5. ANN: Active XL Report 4.1 - Excel reporting with practically no coding
    By Alexander Frolov [Afalina Co., Ltd.] in forum vb.announcements
    Replies: 0
    Last Post: 06-24-2002, 01:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center