473,791 Members | 3,211 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exporting to multiple excel worksheets from asp.net?

Hi,

I'm using ASP.NET 1.1 and trying export a dataset with multiple datatables
(each to it's own Excel worksheet.)

I've successful bound a DataTable a DataGrid using the code below but I
don't know how to create multiple worksheets tabs to correspond to each
datatable.

Response.Conten tType = "applicatio n/vnd.ms-excel";
Response.Charse t = "";
this.EnableView State = false;
StringWriter sw = new StringWriter();
HtmlTextWriter ht = new HtmlTextWriter( sw);
DataGrid1.Rende rControl(ht);
Response.Write( sw.ToString());
Response.End();
Jan 26 '07 #1
1 3901
"Dave" <Da**@discussio ns.microsoft.co mwrote in message
news:80******** *************** ***********@mic rosoft.com...
I'm using ASP.NET 1.1 and trying export a dataset with multiple datatables
(each to its own Excel worksheet.)
No problem.
I've successfully bound a DataTable a DataGrid using the code below but I
don't know how to create multiple worksheets tabs to correspond to each
datatable.
Ah, well for that you have two choices:

1) Use the Excel XML schema file format:
http://www.microsoft.com/downloads/d...displaylang=en

2) Use a 3rd-party product like this:
http://www.aspose.com/Products/Aspos...s/Default.aspx

Don't consider trying to use Office automation, though... it's not designed
for this kind of scneraio, and Microsoft strongly advise against it to the
extent that they will not support any application which uses it:
http://support.microsoft.com/default...US;q257757#kb2
Jan 26 '07 #2

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

Similar topics

13
35565
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet and extract information from specific worksheets and cells. I'm not really sure how to get started with this process. I ran the COM Makepy utility from my PythonWin (IDE from ActiveSTate),
0
4197
by: Shawn | last post by:
I have the basics working as is described in KB199841. I currently have my ASP page loading into Excel by setting the ContentType of the page: <%response.ContentType="application/vnd.ms-excel"%> I can add the following to create multiple worksheets within the Excel file: .... <x:ExcelWorksheets> <x:ExcelWorksheet>
3
9249
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 only exporting to single worksheet. but i need to export data to multiple worksheets. it is very urgent to us. so please help me in code.
0
2688
by: sridevi | last post by:
Hello How to export data from ms-access database to excel worksheet. mainly i need to export data to multiple worksheets. it is very urgent to us. thanks Regards gaffar.
3
4890
by: mphanke | last post by:
Hi, I'm writting an application based on an SQL Server for Order Management. I have some data I want to export to Excel and Word, maybe some day I will implement a serial letter. The problem is I don't have Office installed on my Computer. Is there something I can use for this task on the MSDN-DVDs? Where can I find a couple tutorials on dealing with things like that on the web???
21
6248
by: bobh | last post by:
Hi All, In Access97 I have a table that's greater than 65k records and I'm looking for a VBA way to export the records to Excel. Anyone have vba code to export from access to excel and have the code use multiple excel tabs within a workbook???? Anyone have vba code that would create a temp table write 65,000 records to it, export those to excel, clean the temp table, append the next 65,000 records, export it to excel with a different...
6
2410
by: Coleen | last post by:
Hi All :-) I'm using .Net Framework 1.1, VB and need to be able to download the data from a datagrid into an Excel 2000 spreadsheet for our accounting users. Can anyone please point me to a good link on how to do this or give me some pointers? TIA, Coleen
3
2241
by: devolper | last post by:
I am devolping a web application which which .net reports to a excel work book .each report in one excel sheet.i am using the following code.......... Dim objDestinationExcel As New Excel.Application Dim objDestinationWBS As Excel.Workbooks objDestinationWBS = objDestinationExcel.Workbooks objDestinationWBS.Open(TemplateFileName) Dim objDestinationWB As Excel.Workbook objDestinationWB...
5
7785
by: garethfx | last post by:
Hi all Ive 2 crosstab queries that I have been asked to export the data from to excel. My sql isn't to cleaver so I,m stuck. I need to place the queries outputted data into specific cells in each of 2 worksheets (nice one so far i guess - not). Ive tried throught the macro system and through tools ~office links with no joy. These crosstabs are created each month so that that data will change and therefore will need to effectivly...
0
9512
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
10419
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
10201
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...
1
10147
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9987
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
6770
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5424
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4100
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
3709
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.