Solved

Are there html tags for separating worksheets in Excel?

Posted on 2004-04-30
7
4,780 Views
Last Modified: 2013-11-19
I am working on streaming an html table back to the client to be opened in Excel. All is well except I'm wondering if there is a way to insert a workseet separator so that when the html is opened in excel, the workbook appears with multiple sheets. I am not interested in a solution in xml as I would like to be able to easily format the table with html. I'm hoping to do something like the following:

<workbook><worksheet><table><tr><td>123</td></tr></table></worsheet><worksheet><table>><tr><td>123</td></tr></table></worsheet></workbook>

or:

<table><tr><td>123</td></tr></table><workbookseparator></workbookseparator><table><tr><td>123</td></tr></table>

I don't really care what the "workbook separator" looks like, as long as i can get one html table per worksheet. Thank you.
0
Comment
Question by:mhil
7 Comments
 
LVL 4

Expert Comment

by:apprenti
ID: 10962140
Are there html tags for separating worksheets in Excel?

No.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 10964427
If you are opening in Excel, then HTML has nothing to do with the formatting, the browser is little more than a wrapper for the excell application.

Cd&
0
 
LVL 14

Expert Comment

by:cracky
ID: 10965379
Unfortunately, this isn't as simple as you would like :(

Since you mentioned you only want to do this with HTML, the simple answer to your question is as apprenti says: no, it's not possible.

However, there are a heap of server-side solutions for outputting .xls workbooks in native format, which might be your only option. If you aren't familiar with basic server-side programming, then these links might be of no use to you, but worth a try if you are serious about outputting to Excel:

For PHP: http://sourceforge.net/projects/psxlsgen/
For Python: http://sourceforge.net/projects/pyxlwriter/
For Perl: http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel-0.43/
PEAR Implementation: http://www.weberblog.com/Manuals/Pear/package.fileformats.spreadsheet-excel-writer.html
ASP Script: http://www.hotscripts.com/Detailed/15388.html
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 11

Accepted Solution

by:
sciber_dude earned 500 total points
ID: 10972863
Please see the solution on this page. This shows how u can create multiple worksheets in the Excel from HTML output.

(it is in a loop)

http://www.experts-exchange.com/Web/Web_Languages/XML/Q_20919841.html

:) SD
0
 

Author Comment

by:mhil
ID: 10978421
I guess what I was misleading in saying "Html Tags". What separates the tables is arbitrary. I was just hoping to be able to re-use html components to make life easier for formatting.

SD - the loop you pointed out is just xml output. I was hoping for a solution like the first answer on that page, but I can't seem get multiple tables in one page to each get created in their own worksheets. Any ideas?
0
 

Author Comment

by:mhil
ID: 10981408
Ok, I answered my own question. Here is the html output needed:

<HTML xmlns:x="urn:schemas-microsoft-com:office:excel">
 <HEAD>
  <meta name="Excel Workbook Frameset">
  <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  <meta content="Excel.Sheet" name="ProgId">
  <meta content="Microsoft Excel 11" name="Generator">
  <LINK href="Sheet1.htm">
  <LINK href="Sheet2.htm">
<!--[if gte mso 9]><xml>
 <x:ExcelWorkbook>
  <x:ExcelWorksheets>
   <x:ExcelWorksheet>
    <x:Name>Sheet1</x:Name>
    <x:WorksheetSource HRef="Sheet1.htm"/>
   </x:ExcelWorksheet>
   <x:ExcelWorksheet>
    <x:Name>Sheet2</x:Name>
    <x:WorksheetSource HRef="Sheet2.htm"/>
   </x:ExcelWorksheet>
  </x:ExcelWorksheets>
 </x:ExcelWorkbook>
</xml><![endif]-->
 </HEAD>
 <body>
 </body>
</HTML>

The important thing to note that was missing from similar threads is the "WorksheetSource" and "Link" elements. Basically this output yields a worksheet wrapper page that points to other pages that contain the html tables.
0
 
LVL 11

Expert Comment

by:sciber_dude
ID: 10988426
hmm... glad i could help.

Sorry for not giving you the entire answer, but i was not aware of exactly what you wanted. Good luck.

:) SD

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Change month dropdown 5 32
Stupid git question 2 58
Popup to change image and store url in database 2 30
Javascript to allow login/password authorization 4 27
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now