CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2016
    Location
    Columbus, Ohio, USA
    Posts
    12

    Export List<T> to Excel (QueryTable?)

    After building a list of objects (records of 7 fields), can anyone think of an elegant way to export the list directly to a querytable or Excel in general?

    I understand that there is no order for elements in a generic list, but in every example I have researched on the internet, it boils down to nested loops of cells within objects somewhere. There has to be a set-based way to do the conversion.
    .NET Framework Version 4.5.50938; Visual Studio Professional 2013 Version 12.0.21005.1 REL
    "Having power is nice, having a lot of power is very nice, having too much power is just about right!"

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Export List<T> to Excel (QueryTable?)

    Search the internet for "export a generic list to excel in c#".

  3. #3
    Join Date
    Jun 2016
    Location
    Columbus, Ohio, USA
    Posts
    12

    Re: Export List<T> to Excel (QueryTable?)

    Much appreciated, Arjay. It looks like the most promising will be serialization and reflection. Really didn't find much through Google directly.
    .NET Framework Version 4.5.50938; Visual Studio Professional 2013 Version 12.0.21005.1 REL
    "Having power is nice, having a lot of power is very nice, having too much power is just about right!"

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured