Solved

fille Excel with Datatable

Posted on 2013-11-11
2
302 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Long URL in SMS 6 24
Why don't I see this table in EDMX file? 2 20
ASP.NET Web API or ASP.NET Core MVC? 3 32
C# TextBox 11 15
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed 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 …
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 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

13 Experts available now in Live!

Get 1:1 Help Now