Login
Register
Tutorials
Forum
Career Development
Resources
Reviews
Jobs
Interview
Communities
Projects
Training
Silverlight Games
|
Bookmarks
|
New Members FAQ
|
Mentor
|
Code Converter
|
IT Companies
|
Peer Appraisal
|
Members
|
Revenue Sharing
|
Computer Jokes
|
New Posts
|
Social
|
Talk to Webmaster
Tony John
Facebook
Google+
Twitter
LinkedIn
Online Members
Phagu Mahato
Rakesh Chaubey
srirama
More...
Join our online
Google+ community
for Bloggers, Content Writers and Webmasters
Forums
»
.NET
»
ASP.NET
»
Display multiple datatable in single excel sheet asp.net
Posted Date:
14 Jun 2012
Posted By::
Rajasekar.K
Member Level:
Silver
Member Rank:
419
Points
: 4
Responses:
2
Hi ALL,
I want to display multiple datatable in single excel sheet asp.net
($sheet1)
Like,
1.First table with Header and Rows & Cols Of correspanding table.
2. second table with Header and Rows & Cols Of correspanding table.
Like wise i want to view,
Not like ,
Sheet1- For First Table
Sheet2- For Second Table
Both Table in single work sheet...
Sheet1 - First table & Second Table
Ragards
Rajasekar.K
9710638424
Tweet
Responses
#675591 Author:
Ajesh Madhukar Dalvi
Member Level:
Silver
Member Rank:
760
Date: 15/Jun/2012 Rating:
Points
: 4
string attachment = "attachment; filename=Test.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/vnd.ms-excel";
string tab = "";
foreach(DataTable dt in ds.Tables)
{
foreach (DataColumn dc in dt.Columns)
{
Response.Write(tab + dc.ColumnName);
tab = "\t";
}
Response.Write("\n");
int i;
foreach (DataRow dr in dt.Rows)
{
tab = "";
for (i = 0; i < dt.Columns.Count; i++)
{
Response.Write(tab + dr[i].ToString());
tab = "\t";
}
Response.Write("\n");
}
Response.Write("\n");
}
Response.End();
#677250 Author:
Rajasekar.K
Member Level:
Silver
Member Rank:
419
Date: 25/Jun/2012 Rating:
Points
: 1
Thanks for replay ...
i got it...
Post Reply
This thread is locked for new responses. Please post your comments and questions as a
separate thread
.
If required, refer to the URL of this page in your
new post
.
Tweet
Next :
What programming used ?
Previous :
Restrict the folder access from being access
Return to Discussion Forum
Post New Message
Category:
Related Messages
Validation Controls
no of click on advertisement in asp.net application
Please Please help.................. tooo urgent
Please tell me .Net interview Questions for 2+ Years Exp
To upload Documents like(doc,pdf,etc) to file system
Follow us on Twitter:
https://twitter.com/dotnetspider
Active Members
Today
Phagu Mahato
(4)
Last 7 Days
baskar
(293)
Asheej T K
(203)
srisunny
(176)
more...
Awards & Gifts
Email subscription
.NET Jobs
.NET Articles
.NET Forums
Articles Rss Feeds
Forum Rss Feeds
About Us
Contact Us
Copyright
Privacy Policy
Terms Of Use
Revenue Sharing sites
Advertise
Talk to
Tony John
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2012 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.