Solved

Are there html tags for separating worksheets in Excel?

Posted on 2004-04-30
7
4,989 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to copy file 14 52
HTML question 2 26
output in HTML in Powershell 5 28
output in HTML format powershell 6 23
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

733 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