?
Solved

Are there html tags for separating worksheets in Excel?

Posted on 2004-04-30
7
Medium Priority
?
5,286 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
WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

 
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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Find out what you should include to make the best professional email signature for your organization.
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…
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 …
Suggested Courses

777 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