By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,950 Members | 1,019 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,950 IT Pros & Developers. It's quick & easy.

Export multiple worksheet to excel

P: 14
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.ContentType = "application/vnd.ms-excel"

<xml><x:ExcelWorkbook> <x:ExcelWorksheets><x:ExcelWorksheet><x:Name>"Work sheet1"</x:Name>
<x:WorksheetOptions><x:Print><x:ValidPrinterInfo/></x:Print><x:Selected/><x:DoNotDisplayGridlines/></x:WorksheetOptions>
</x:ExcelWorksheet>
<x:ExcelWorksheet><x:Name>Worksheet2</x:Name><x:WorksheetOptions><x:Print><x:ValidPrinte rInfo/></x:Print><x:Selected/><x:DoNotDisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets>
</x:ExcelWorkbook>

any help will be greatly appreciated. thanks!
Sep 21 '07 #1
Share this Question
Share on Google+
2 Replies


P: 73
Hi,

You may consider the code below. Enjoy!

Response.AppendHeader("content-disposition", "attachment; filename=" + "Doc1.xls")
' Set MIME type to Excel.
Response.ContentType = "application/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.ContentType = "application/vnd.ms-excel"

<xml><x:ExcelWorkbook> <x:ExcelWorksheets><x:ExcelWorksheet><x:Name>"Work sheet1"</x:Name>
<x:WorksheetOptions><x:Print><x:ValidPrinterInfo/></x:Print><x:Selected/><x:DoNotDisplayGridlines/></x:WorksheetOptions>
</x:ExcelWorksheet>
<x:ExcelWorksheet><x:Name>Worksheet2</x:Name><x:WorksheetOptions><x:Print><x:ValidPrinte rInfo/></x:Print><x:Selected/><x:DoNotDisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets>
</x:ExcelWorkbook>

any help will be greatly appreciated. thanks!
Sep 21 '07 #2

P: 14
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.AppendHeader("content-disposition", "attachment; filename=" + "Doc1.xls")
' Set MIME type to Excel.
Response.ContentType = "application/octet-stream"

regards,
ruel
Sep 21 '07 #3

Post your reply

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