473,405 Members | 2,344 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Datagrid - Excel help

Hi,

I have generated a datagrid with the following columns:

| Date-Time | Station ID | Parameter1 | .... | Parameter 2|

I would like to:

Create an Excel file and preferably give the user a choice to create one
separate Excel file per Station ID.

Also, later on i want to perform various statistics on the data that is too
hard to do with SQL (moving averages, etc.), since a datagrid means that
the data resides in memory , is it the best choice for me?
I mean, Create a Dataset, Populate a Datagrid, then do the statistics
through VB ?

Any suggestions, comments would be greately appreciated!
TIA
-steve

Nov 21 '05 #1
1 1372
Something like this can be used to work with Excel in VB.Net.
You might need to download and install
Microsoft.Visual.Studio.Tools.for.the.Microsoft.Of fice.System to be able to
do this.

Imports Office = Microsoft.Office.Core
Imports Excel = Microsoft.Office.Interop.Excel

objExcel = CreateObject("excel.application")
objBook = objExcel.Workbooks.Open("C:\test.xls")
objSheet = objBook.Worksheets(1)
objSheet.Activate()
objSheet.Cells(1, 1) = "description"
objExcel.ActiveWorkbook.SaveAs( "c:\test.xls" )
objExcel.ActiveWorkbook.Close(savechanges:=False)
objSheet = Nothing
objBook = Nothing
objExcel = Nothing

"steve" <st***@here.com> wrote in message
news:i3*********************@wagner.videotron.net. ..
Hi,

I have generated a datagrid with the following columns:

| Date-Time | Station ID | Parameter1 | .... | Parameter 2|

I would like to:

Create an Excel file and preferably give the user a choice to create one
separate Excel file per Station ID.

Also, later on i want to perform various statistics on the data that is
too
hard to do with SQL (moving averages, etc.), since a datagrid means that
the data resides in memory , is it the best choice for me?
I mean, Create a Dataset, Populate a Datagrid, then do the statistics
through VB ?

Any suggestions, comments would be greately appreciated!
TIA
-steve

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Faith | last post by:
Hello. I need to take a column from Excel(unknown amount of rows) that will be selected by the user and copy those cells. Then I will need to paste those cells into the first column in a Data...
5
by: samik_tanik | last post by:
I need to export a datagrid to Excel. I could did this. But, also need to keep the leading zeros in the data. How can I acheive this? Any help would be appreciated. -- Thanking you in...
1
by: Ugo | last post by:
Hi, I am having a problem exporting a Datagrid to excel in asp.net. For some reason I am getting a blank excel page. I set up in IIS the Mime for ..xls. My code is below any help would be...
3
by: Syd | last post by:
Hi all, Is there a way to get data from a datagrid and send to an excel table?And if it is possible how can arranged the excel table... Thanks
6
by: Eric | last post by:
Dear All, I want to export datagrid content to a Excel file, the code just like below: Response.ContentType = "application/vnd.ms-excel" Response.Charset = "" Me.EnableViewState = False Dim...
2
by: Steve Chatham | last post by:
I use the following code: Private Sub RbtnExport_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RbtnExport.SelectedIndexChanged Dim sFile As String =...
0
by: optimizeit | last post by:
What I am attempting to do is import an Excel Workbook and display the worksheets in a datagrid dynamically. I am very close to getting this to work. I have to this point successfully imported a...
3
by: nkunkov | last post by:
Hi, I have read a lot of articles in this newsgroup about how to solve this problem but found no solution. I'm trying to export a C# datagrid to Excel file. Here is my code that I have also...
4
by: Frank | last post by:
Hello All, I ham using VS.NET 2003. Have followed instructions from http://gridviewguy.com/ArticleDetails.aspx?articleID=26 along with several other articles to no avail. I am pulling my hair...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.