473,386 Members | 1,745 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,386 software developers and data experts.

Exporting to Excel via memory-stream

Hi

I´m trying to export a datatable to Excel. So far I have set up a file
dump and can start Excel to read from that file.
Now, my question is this: Since I have a stream, could I convert it to
a MemoryStream, start an Excel process and instruct it to read the
memory stream instead of a filepath.
I do realize that proceses can not normally access another process
recources, but hopefully there is a way around this!

Or is there perhaps another way to do this??
Primary reason for wanting to do this, is that by opening a saved file
from Excel, will not open the Save-dialog when the user saves the file
(unless he/she presses SaveAs).

Thanks,
Magnús
Jul 21 '05 #1
2 4816
wait, you DO or you DO NOT want the Save dialog to appear?

You can stuff a datatable into Excel using ADO.NET (no automation)

http://www.winisp.net/cheeso/srcview...actToExcel2.cs

-D

"magnus" <ma******@simnet.is> wrote in message
news:52**************************@posting.google.c om...
Hi

I´m trying to export a datatable to Excel. So far I have set up a file
dump and can start Excel to read from that file.
Now, my question is this: Since I have a stream, could I convert it to
a MemoryStream, start an Excel process and instruct it to read the
memory stream instead of a filepath.
I do realize that proceses can not normally access another process
recources, but hopefully there is a way around this!

Or is there perhaps another way to do this??
Primary reason for wanting to do this, is that by opening a saved file
from Excel, will not open the Save-dialog when the user saves the file
(unless he/she presses SaveAs).

Thanks,
Magnús

Jul 21 '05 #2
I basicly want to open up a new instance of an Excel worksheet and
dump a DataTable into that, then when the users press Ctrl-S the
save-dialog pops up (as the file has not been saved yet).

Currently I'm writing to a file, then starting a new Excel process,
instructing it to read that file.
That, of course, causes some confusion with the users, as they are
saving the file (when pressing Ctrs-S) to the temp directory (never to
be found again :S )

thanks,
Magnús

"Dino Chiesa [Microsoft]" <di****@online.microsoft.com> wrote in message news:<uw**************@TK2MSFTNGP11.phx.gbl>...
wait, you DO or you DO NOT want the Save dialog to appear?

You can stuff a datatable into Excel using ADO.NET (no automation)

http://www.winisp.net/cheeso/srcview...actToExcel2.cs

-D

"magnus" <ma******@simnet.is> wrote in message
news:52**************************@posting.google.c om...
Hi

I´m trying to export a datatable to Excel. So far I have set up a file
dump and can start Excel to read from that file.
Now, my question is this: Since I have a stream, could I convert it to
a MemoryStream, start an Excel process and instruct it to read the
memory stream instead of a filepath.
I do realize that proceses can not normally access another process
recources, but hopefully there is a way around this!

Or is there perhaps another way to do this??
Primary reason for wanting to do this, is that by opening a saved file
from Excel, will not open the Save-dialog when the user saves the file
(unless he/she presses SaveAs).

Thanks,
Magnús

Jul 21 '05 #3

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

Similar topics

3
by: sridevi | last post by:
Hello How to export data from ms-access database to excel worksheet using ASP. mainly i need to export data to multiple worksheets. it is very urgent to us. i have a sample code which works...
4
by: D | last post by:
I've created a report with many subreports of aggregate data. I want my client to be able to export this data to Excel to make her charts, etc. Only one problem: one of the fields is a "SchoolYear"...
2
by: G | last post by:
When I export data from access to excel by with "export" or "Analyze with" I seem to loose parts of some fields (long text strings). Is there a way to export it all to excel? Thanks G
2
by: Kenneth | last post by:
How do I remove the limitation in Access that deny me from exporting 24000 rows and 17 columns (in a query) into Excel? Kenneth
5
by: Neil | last post by:
Hi I'm currently exporting my datagrid to excel, taking advantage of the fact that excel can render html, the problem is that when i click the button to export it opens in browser, I want the button...
1
by: Mustufa Baig | last post by:
I have an ASP.NET website where I am showing off crystal reports to users by exporting them to pdf format. Following is the code: ---------------- 1 Private Sub ExportReport() 2 Dim oStream...
2
by: bienwell | last post by:
Hi, I have a question about exporting data from datagrid control into Excel file in ASP.NET. On my Web page, I have a linkbutton "Export data". This link will call a Sub Function to perform...
2
by: Snozz | last post by:
The short of it: If you needed to import a CSV file of a certain structure on a regular basis(say 32 csv files, each to one a table in 32 databases), what would be your first instinct on how to...
4
by: Tom | last post by:
I have a gridview on all of my web pages in my web app and they all export to excel. I have one page where the gridview is binding to a datatable that i created and only the first column is...
7
by: leninv | last post by:
Hi, I have the following code where 'recs' is a record set. For i=0 to recs.Fields.Count - 1 if i = 0 then pindnt = string(itmlvl*2," ") response.write pindnt &...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
0
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...
0
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...

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.