Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
* * * * - 1 votes

Export To Excel Easy (From Datatables)

Xls excel DataTable CSV streamwriter

  • Please log in to reply
4 replies to this topic

#1 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts
  • Location:Argentina
  • Programming Language:C, C++, C#, PHP, JavaScript, Transact-SQL, Bash, Others
  • Learning:Java, Others

Posted 26 May 2012 - 05:58 PM

This sample code will help you in your daily and maybe boring repetitive office task named : getting some query and exporting it to excel so someone else can work with the data.

Attached Files


Edited by BlackRabbit, 24 November 2015 - 10:30 AM.

  • 2

#2 tavichh

tavichh

    CC Addict

  • Senior Member
  • PipPipPipPipPip
  • 399 posts
  • Location:Delaware
  • Programming Language:C#
  • Learning:C++, PHP, JavaScript

Posted 26 May 2012 - 07:56 PM

Awesome!
+1
  • 0
Send a like my way if I helped you or if you found my post useful or even just enjoyed reading my post.
Thank you :)

#3 longtx998

longtx998

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts
  • Programming Language:C

Posted 30 November 2012 - 11:51 AM

hi, just tried your implementation, it is great, however there is one issue, it is really slow for large data set, is there any way we can speed it up.

thanks,
  • 0

#4 tavichh

tavichh

    CC Addict

  • Senior Member
  • PipPipPipPipPip
  • 399 posts
  • Location:Delaware
  • Programming Language:C#
  • Learning:C++, PHP, JavaScript

Posted 30 November 2012 - 02:34 PM

hi, just tried your implementation, it is great, however there is one issue, it is really slow for large data set, is there any way we can speed it up.

thanks,

That does not seem like a problem with the coding, more like a computer problem. It looks like your CPU ( Processor ) or your Hard Drive is not reading the file or creating the file fast enough.
Buying a better CPU or HD will improve the speed.
  • 1
Send a like my way if I helped you or if you found my post useful or even just enjoyed reading my post.
Thank you :)

#5 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts
  • Location:Argentina
  • Programming Language:C, C++, C#, PHP, JavaScript, Transact-SQL, Bash, Others
  • Learning:Java, Others

Posted 01 December 2012 - 10:16 AM

Thryckz just gave one answer, another possibility is about the DataGridView. Just like excel takes its time to load a large file, so does the Datagridview, wich is very slow i might add, in order to solve that issue you can try pagination.

check up this link: DatagridView Pagination sample code
  • 0





Also tagged with one or more of these keywords: Xls, excel, DataTable, CSV, streamwriter

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download