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

Grid in email

Is there a way to easily put a Datagrid in an email?

I want to send a select result in the form of a Datagrid via an email to
some of our clients.

Thanks,

Tom
Dec 29 '05 #1
5 2294
About a month ago I had the same situation and didn't find a way to do it,
at least an easy way. I ended creating an .html with <table>'s, reading that
HTML and asigning values to it. Then sending it through email.body

I can send you the code if you want it.

"tshad" <tf*@dslextreme.com> wrote in message
news:Ot**************@tk2msftngp13.phx.gbl...
Is there a way to easily put a Datagrid in an email?

I want to send a select result in the form of a Datagrid via an email to
some of our clients.

Thanks,

Tom

Dec 29 '05 #2
Create the HTML markup for the table and use it as the body for the email.
The email should have the body content type as HTML

"tshad" <tf*@dslextreme.com> wrote in message
news:Ot**************@tk2msftngp13.phx.gbl...
Is there a way to easily put a Datagrid in an email?

I want to send a select result in the form of a Datagrid via an email to
some of our clients.

Thanks,

Tom

Dec 29 '05 #3
So it has to be done by hand then.

I was hoping there was someway to use a Datagrid or datalist to create the
table and put the table into the body of the message.

Thanks,

Tom
"Siva M" <sh******@online.excite.com> wrote in message
news:eQ*************@TK2MSFTNGP12.phx.gbl...
Create the HTML markup for the table and use it as the body for the email.
The email should have the body content type as HTML

"tshad" <tf*@dslextreme.com> wrote in message
news:Ot**************@tk2msftngp13.phx.gbl...
Is there a way to easily put a Datagrid in an email?

I want to send a select result in the form of a Datagrid via an email to
some of our clients.

Thanks,

Tom

Dec 30 '05 #4
Well, there is way to do it:

System.Text.StringBuilder sb = new System.Text.StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter htw = new HtmlTextWriter(sw);
DataGrid.RenderControl(htw);
// Now, sb.ToString() will get you the HTML for the DataGrid.

"tshad" <tf*@dslextreme.com> wrote in message
news:O2*************@TK2MSFTNGP12.phx.gbl...
So it has to be done by hand then.

I was hoping there was someway to use a Datagrid or datalist to create the
table and put the table into the body of the message.

Thanks,

Tom
"Siva M" <sh******@online.excite.com> wrote in message
news:eQ*************@TK2MSFTNGP12.phx.gbl...
Create the HTML markup for the table and use it as the body for the email.
The email should have the body content type as HTML

"tshad" <tf*@dslextreme.com> wrote in message
news:Ot**************@tk2msftngp13.phx.gbl...
Is there a way to easily put a Datagrid in an email?

I want to send a select result in the form of a Datagrid via an email to
some of our clients.

Thanks,

Tom


Dec 31 '05 #5
"Siva M" <sh******@online.excite.com> wrote in message
news:e7*************@TK2MSFTNGP12.phx.gbl...
Well, there is way to do it:

System.Text.StringBuilder sb = new System.Text.StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter htw = new HtmlTextWriter(sw);
DataGrid.RenderControl(htw);
That sounds interesting.

Would I do this in my Page_load or PostBack after Binding the DataGrid?

I assume it would be something like:

dbReader = myDbObject.RunProcedure("GetEmployerFavorites", parameters)
<--Gets my data
SubmissionsGrid.DataSource = dbReader
SubmissionsGrid.DataBind()
<-- Bind the data to the datagrid

System.Text.StringBuilder sb = new System.Text.StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter htw = new HtmlTextWriter(sw);
DataGrid.RenderControl(htw);

I can now take SB and combine it with my email and send it to someone ?

Thanks,

Tom
// Now, sb.ToString() will get you the HTML for the DataGrid.

"tshad" <tf*@dslextreme.com> wrote in message
news:O2*************@TK2MSFTNGP12.phx.gbl...
So it has to be done by hand then.

I was hoping there was someway to use a Datagrid or datalist to create the
table and put the table into the body of the message.

Thanks,

Tom
"Siva M" <sh******@online.excite.com> wrote in message
news:eQ*************@TK2MSFTNGP12.phx.gbl...
Create the HTML markup for the table and use it as the body for the
email.
The email should have the body content type as HTML

"tshad" <tf*@dslextreme.com> wrote in message
news:Ot**************@tk2msftngp13.phx.gbl...
Is there a way to easily put a Datagrid in an email?

I want to send a select result in the form of a Datagrid via an email to
some of our clients.

Thanks,

Tom


Jan 11 '06 #6

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

Similar topics

3
by: Ray Lavelle | last post by:
I'm upgrading my application to .Net and need a grid control replacement for my old one. I was using the Farpoint control, which I really like but the new version for .Net is fairly expensive. I...
6
by: Satyen Kasturi | last post by:
I want to use a plain grid control in VB.NET (Windows Forms) and yes I do not want to use Data Grid, because I want to populate the grid manully and have the user edit it. Does Microsoft has a...
117
by: phil-news-nospam | last post by:
Is there really any advantage to using DIV elements with float style properies, vs. the old method of TABLE and TR and TD? I'm finding that by using DIV, it still involves the same number of...
10
by: kaczmar2 | last post by:
Hey there, I have a large image in a browser window, and I would like a way to overlay grid lines on top of the image, so a user can show the grid or hide the grid lines. The grid would cover...
3
by: kaczmar2 | last post by:
Hey there, I have a large image in a browser window, and I would like a way to overlay grid lines on top of the image, so a user can show the grid or hide the grid lines. The grid would cover...
4
by: BH | last post by:
Hi ! I have a small problem with wx.Grid and scrollbars. Scrollbars definitively dissapears after resizing the frame. Thx for help ...
7
by: moondaddy | last post by:
I have WPF window and a grid. The grid has several columns and rows. How do I add an object to a specific row and column of the gird using c#? If I use: myGrid.Children.Add(dg); then dg...
11
by: dongarbage | last post by:
I'm building an application (WPF) and I have a Panel in the application which will be populated dynamically with objects of the type Grid, TextBox, etc. For simplicity, let's say I'm just adding...
6
by: Romulo NF | last post by:
Greetings again to everyone, Im back to show this grid componenet i´ve developed. With this grid you can show the data like a normal table, remove the rows that you need, add rows, import data,...
2
by: skanemupp | last post by:
so my little calculator works perfectly now. just having some trouble with the layout. this whole tkinter-thing seems to be more tricky than it should be. how can i make the 4 column of buttons...
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
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...
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.