Solved

fille Excel with Datatable

Posted on 2013-11-11
2
304 Views
Last Modified: 2013-11-25
Is there a way to fill Excel with datatable in vb.net and save it as a file?
0
Comment
Question by:VBdotnet2005
2 Comments
 
LVL 29

Accepted Solution

by:
anarki_jimbel earned 250 total points
ID: 39640574
There are examples and tutorial on Internet. You may find one on the MSDN web site:

http://code.msdn.microsoft.com/office/Export-DataTable-object-to-b3e2c1f0

The link is about importing dataset into Excel using VB.Net.
0
 
LVL 20

Assisted Solution

by:ElrondCT
ElrondCT earned 250 total points
ID: 39640711
The method shown in the article anarki_jimbel links to will work, but it's painfully slow. If your output has more than a few thousand cells, the overhead of doing each cell individually will kill you. You're much better off loading an array with the values from the DataTable, then loading the entire array into Excel using a command like
Dim oRange As Excel.Range = excelWorkSheet.Range("A1")
oRange.Value = oData

Open in new window

where excelWorkSheet is an individual sheet in a receiving Excel workbook (file) and oData is a two-dimensional array of values, which you would completely load before executing these lines.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Error in script 11 45
Ajax Panel Not Updating When Triggered By Timer 4 40
Wav problem 4 13
Show/Hide ASP.NET controls with JQuery best practices 3 17
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now