473,327 Members | 2,055 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,327 software developers and data experts.

repost -- asp .net / save Excel on server

Hi all,

This is a repost from a week or so ago. I'll try to reformat so it is
more clear.

I am looking for something in asp .net / vb .net that will export a
datagrid to Excel, BUT will save the file on the server (not the
client). Can this be done without Excel installed on the server?

Is there a was to send the contents of a datagrid as an excel
attachment to an email. Or even embedded in the email?

If possible, the solution should not require excel to be installed on
the server and should allow formatting of the excel to make it more
readable. Specifically, I would like the longer fields to word wrap
within the cell instead of being cut off or continuously on one line.
Any help is appreciated. I don't mind doing the research and learning
how to do this, but I am coming up blank so far. Anything with Excel
turns up so many hits it is hard to read it all.
Thanks again.

Mar 7 '06 #1
4 1346
Is your data from the datagrid stored in a dataset? I would assume so.
In that case you can create your Excel file in memory and store it
where ever you want (server, client, email).

Are you just doing a single worksheet? In that case you might just want
to create a CSV file that doesn't require Excel. If you need a more
complex workbook, then have a look at the CarlosAG ExcelWriter.

If you need more help drop me a private email.

Mar 7 '06 #2
I copied this from a post I made a while back. Have you considered just
changing the MIMEType of your asp.net page such that it's opened by
Excel?

Example:

<%@ Page Language="C#"%>
<script runat=server>
void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "application/vnd.ms-excel";
}
</script>
<table>
<tr>
<td><b>Column 1</b></td>
<td style="width: 300px;"><b>Column 2</b></td>
</tr>
<tr>
<td style="background-color: yellow; color:
red;">Value</td>
<td>Another Value</td>
</tr>
</table>

-Alan

Mar 8 '06 #3
Thanks Alan, but I do not understand how this can save a file to the
server or send an attachment with email.

Mar 10 '06 #4
It can't attach to an email. However, if you have control over the
server, you could save an HTML document to the server w/ an .xls
extension and write an HttpHandler that'll include the header when a
page w/ the .xls extension is requested.

-Alan

Mar 10 '06 #5

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

Similar topics

5
by: Alan | last post by:
Hi there, Are there Excel charting gurus here?? If so then please read on... Sorry for the cross-post but I'm not familiar with the Excel groups. I've posted to asp.general because if I have...
4
by: Jae | last post by:
I'm writing a web application that exports and imports excel files. The application gets a list of users and their info and displays it in a datagrid .The user then selects to save the file as a...
1
by: rn5a | last post by:
When users submit a Form with a SQL query, the resultset is retrieved from a MS-Access database table which is then exported to an MS-Excel worksheet. After the records get exported to MS-Excel, I...
3
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have a question for you. I have a .csv file which has many lines of data. Each line has many data fields which are delimited by ",". Now I need to extract part of data from this...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.