473,652 Members | 3,045 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Export multiple worksheet to excel

14 New Member
Hi guys,

i'm able to export data to an excel from my asp .net page, i can even create multiple worksheets. the problem is, i can not specify where worksheet should the data be placed. below is my sample code...

response.Conten tType = "applicatio n/vnd.ms-excel"

<xml><x:ExcelWo rkbook> <x:ExcelWorkshe ets><x:ExcelWor ksheet><x:Name> "Worksheet1 "</x:Name>
<x:WorksheetOpt ions><x:Print>< x:ValidPrinterI nfo/></x:Print><x:Sele cted/><x:DoNotDispla yGridlines/></x:WorksheetOpti ons>
</x:ExcelWorkshee t>
<x:ExcelWorkshe et><x:Name>Work sheet2</x:Name><x:Works heetOptions><x: Print><x:ValidP rinterInfo/></x:Print><x:Sele cted/><x:DoNotDispla yGridlines/></x:WorksheetOpti ons></x:ExcelWorkshee t></x:ExcelWorkshee ts>
</x:ExcelWorkbook >

any help will be greatly appreciated. thanks!
Sep 21 '07 #1
2 3492
aliasruel
73 New Member
Hi,

You may consider the code below. Enjoy!

Response.Append Header("content-disposition", "attachment ; filename=" + "Doc1.xls")
' Set MIME type to Excel.
Response.Conten tType = "applicatio n/octet-stream"

regards,
ruel





Hi guys,


i'm able to export data to an excel from my asp .net page, i can even create multiple worksheets. the problem is, i can not specify where worksheet should the data be placed. below is my sample code...

response.Conten tType = "applicatio n/vnd.ms-excel"

<xml><x:ExcelWo rkbook> <x:ExcelWorkshe ets><x:ExcelWor ksheet><x:Name> "Worksheet1 "</x:Name>
<x:WorksheetOpt ions><x:Print>< x:ValidPrinterI nfo/></x:Print><x:Sele cted/><x:DoNotDispla yGridlines/></x:WorksheetOpti ons>
</x:ExcelWorkshee t>
<x:ExcelWorkshe et><x:Name>Work sheet2</x:Name><x:Works heetOptions><x: Print><x:ValidP rinterInfo/></x:Print><x:Sele cted/><x:DoNotDispla yGridlines/></x:WorksheetOpti ons></x:ExcelWorkshee t></x:ExcelWorkshee ts>
</x:ExcelWorkbook >

any help will be greatly appreciated. thanks!
Sep 21 '07 #2
prinsipe
14 New Member
hehe...tried searching on how to implement this on export then directing the data to other worksheet but have no luck of finding one that can help me. do you any resource material or link that i can check? thanks for your reply =)


Hi,

You may consider the code below. Enjoy!

Response.Append Header("content-disposition", "attachment ; filename=" + "Doc1.xls")
' Set MIME type to Excel.
Response.Conten tType = "applicatio n/octet-stream"

regards,
ruel
Sep 21 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
8667
by: Igor | last post by:
Hi everyone! I have a question about exporting data to Microsoft Excel. I am writing program in C# and have to export some data to excel workbook. It works very good using OLE technology, but it requires Microsoft Excel installed on every machine with my program. It is not quite convenient to do so. Is there another way to export data to Excel, or how simply create file of Microsoft Excel format from my program (of cause, the format of...
0
1244
by: Dayron | last post by:
Hi, I'm retreving a large bunch of records from database and I wish to disply the records in the excel workbook. unfortunately the worksheet just can support until 65,535 records in a single worksheet but i have 500,000 records to be displayed. so i need to put the records in multiple worksheet but under one workbook. how can i do this using asp? *** Sent via Developersdex http://www.developersdex.com ***
4
33459
by: Hans [DiaGraphIT] | last post by:
Hi! I want to export a dataset to an excel file. I found following code on the net... ( http://www.codeproject.com/csharp/Export.asp ) Excel.ApplicationClass excel = new ApplicationClass(); excel.Application.Workbooks.Add(true); DataTable table = DATASETNAME.Tables;
6
3722
by: Sridhar | last post by:
Hi, I have to export data inside the datagrid into an excel worksheet. I have to do this on button click event. I am trying to do like this. First get the DataTable from the datagrid and iterate through each row to get the data. I am not able to get the DataTable from the datagrid. How could I do that? I tried like this but it is not working Dim dt as DataTable = CType(datagrid1.DataSource, DataTable)
2
1644
by: Phoon Chee Keong | last post by:
Hi, Anyone know how to export to excel? Any example that I can refer? Regards, PCK
6
4058
by: Elena | last post by:
I'm trying to export data to an Excel worksheet. I can export the data in the cell values perfectly. I need the code to change a header and footer for the worksheet, not for the columns. Is this possible? If so, I really need the code immediately. Thank you, Elena
4
3349
by: forrestgump | last post by:
I want to be able to export multiple access query results to 1 excel worksheet so the results appear under each other. I need this to show the results of headcount, leavers and starters in a cost centre. I do not want to have to run 3 separate reports on 3 different tabs. I want them all on 1 tab and under each other. I can run vba to pull 1 query at a time but I can't find what I need for the above. Can anyone offer any advice or good...
3
6240
by: sejal17 | last post by:
hello Can any one tell me how to read multiple worksheets from a single excel file.I have stored that excel in xml file.so i want to read that xml that has multiple worksheet.And i want to store that multiple worksheet data in different table.How can i do it.Below is my xml file. <?xml version="1.0"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" ...
3
5387
by: sejal17 | last post by:
hello Can any one tell me how to read multiple worksheets from a single excel file.I have stored that excel in xml file.so i want to read that xml that has multiple worksheet.And i want to store that multiple worksheet data in different table.How can i do it.Below is my xml file. <?xml version="1.0"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office"...
0
8367
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8279
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
8811
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...
1
8467
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
7302
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5619
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
4145
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
2703
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
1
1914
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.