473,657 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1389
Something like this can be used to work with Excel in VB.Net.
You might need to download and install
Microsoft.Visua l.Studio.Tools. for.the.Microso ft.Office.Syste m to be able to
do this.

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

objExcel = CreateObject("e xcel.applicatio n")
objBook = objExcel.Workbo oks.Open("C:\te st.xls")
objSheet = objBook.Workshe ets(1)
objSheet.Activa te()
objSheet.Cells( 1, 1) = "descriptio n"
objExcel.Active Workbook.SaveAs ( "c:\test.xl s" )
objExcel.Active Workbook.Close( savechanges:=Fa lse)
objSheet = Nothing
objBook = Nothing
objExcel = Nothing

"steve" <st***@here.com > wrote in message
news:i3******** *************@w agner.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
32931
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 Grid (system.windows.forms). Basically, the user receives a list of clientIDs from a client as an email attachment in Excel listed like: 1234 ABC Company 234 DEF Company 348 GHI Company
5
11496
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 anticipation, Regards,
1
10912
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 appreciated.. Thanks CODE: private void ExportToExcel()
3
3506
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
5887
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 tw As New System.IO.StringWriter() Dim hw As New System.Web.UI.HtmlTextWriter(tw) gridList.Columns(0).Visible = False
2
2472
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 = Session("User") & "-Customer List-" & Today() sFile = sFile.Replace("/", "") RbtnExport.Visible = False Select Case RbtnExport.SelectedItem.Value Case "Excel" Response.ContentType = "application/x-msexcel"
0
1693
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 single worksheet into a dataset. I successfully built a dynamic datagrid. And I did successfully bind it to the dataset. Then I added the datagrid control to a PlaceHolder. The first worksheet displays beautifully. The next step is to allow...
3
1802
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 found on google: MyDataGrid.EnableViewState = false; MyPage.Response.Clear(); MyPage.Response.Buffer = true; MyPage.Response.AddHeader( "Content-disposition",
4
3936
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 out at this point. What I have is this : Members.aspx file:
0
8413
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8324
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8842
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8740
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8617
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7352
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2742
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.