Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Are there html tags for separating worksheets in Excel?

Posted on 2004-04-30
7
Medium Priority
?
5,488 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 11

Accepted Solution

by:
sciber_dude earned 1000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

610 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