Solved

Formatting Excel via XML, possible... how?

Posted on 2003-10-31
4
465 Views
Last Modified: 2009-06-02
Okay, here's the poop...
I'm creating a Excel worksheet through ASP by creating a table and declaring the 'Response.ContentType = "application/vnd.ms-excel"'.. That's cool, it works great and I get a nice looking Excel spreadsheet showing up in my browser.  Now for the tough part...

Is there any way of controlling the printing parameters for this spreadsheet via XML elements.  I've tried the following:

<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<HEAD>
  <title>excelTest</title>
    <meta name="vs_defaultClientScript" content="VBScript">
    <LINK rel="stylesheet" type="text/css" href="http://localhost/PhotoViewer/Styles.css">
    <xml>
      <o:DocumentProperties>
        <o:LastAuthor>Whomever</o:LastAuthor>
        <o:Created>2003-10-31T19:42:50Z</o:Created>
        <o:LastSaved>2003-10-31T19:42:50Z</o:LastSaved>
        <o:Version>9.2812</o:Version>
      </o:DocumentProperties>
      <o:OfficeDocumentSettings>
        <o:DownloadComponents/>
        <o:TargetScreenSize>640x480</o:TargetScreenSize>
        <o:LocationOfComponents HRef="file:\\nt_part\off2kp\msowc.cab"/>
      </o:OfficeDocumentSettings>
      <x:ExcelWorkbook>
        <x:ExcelWorksheets>
          <x:ExcelWorksheet>
            <x:Name>Heavy Trucks</x:Name>
            <x:WorksheetOptions>
              <x:DefaultRowHeight>210</x:DefaultRowHeight>
              <x:FitToPage/>
                <x:Print>
                  <x:FitHeight>99</x:FitHeight>
                  <x:ValidPrinterInfo/>
                  <x:Scale>59</x:Scale>
                  <x:HorizontalResolution>600</x:HorizontalResolution>
                  <x:VerticalResolution>0</x:VerticalResolution>
                </x:Print>
                <x:Selected/>
                <x:Panes>
                  <x:Pane>
                    <x:Number>3</x:Number>
                    <x:RangeSelection>A1:X1</x:RangeSelection>
                  </x:Pane>
                </x:Panes>
                <x:ProtectContents>False</x:ProtectContents>
                <x:ProtectObjects>False</x:ProtectObjects>
                <x:ProtectScenarios>False</x:ProtectScenarios>
              </x:WorksheetOptions>
            </x:ExcelWorksheet>
          </x:ExcelWorksheets>
          <x:WindowHeight>10545</x:WindowHeight>
          <x:WindowWidth>17280</x:WindowWidth>
          <x:WindowTopX>0</x:WindowTopX>
          <x:WindowTopY>1410</x:WindowTopY>
          <x:ProtectStructure>False</x:ProtectStructure>
          <x:ProtectWindows>False</x:ProtectWindows>
        </x:ExcelWorkbook>
      <x:ExcelName>
        <x:Name>Print_Titles</x:Name>
        <x:SheetIndex>1</x:SheetIndex>
        <x:Formula>='Heavy Trucks'!$1:$7</x:Formula>
      </x:ExcelName>
    </xml>

Also, is there anywhere one can look (preferably on the Internet) to find a reference of the different elements available for MS Office apps like Excel?  I picked these up by saving my worksheet as an HTML document and copying and pasting the values into my program.

Thanks in advance.
0
Comment
Question by:jstradtman
  • 2
4 Comments
 
LVL 1

Expert Comment

by:RickAtKnowWare
ID: 10826714
I know I've seen a document on the Microsoft website that list all of the elements.  I specifically remember a description of the FitToPage element along with hundreds of others.  I remember saving a link to the document, but now I can't find it!  Has anyone else seen this?
0
 
LVL 1

Accepted Solution

by:
RickAtKnowWare earned 500 total points
ID: 10829012
I found it.  It is a document that you can download.  The URL is http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoffxml/html/ofxml2k.asp00a2662442d9&displaylang=en

There is also a more recent document but when I looked at it, I found that it seemed to be missing a lot of the elements that were in the earlier one.  The URL for that is:
http://www.microsoft.com/downloads/details.aspx?FamilyID=fe118952-3547-420a-a412-00a2662442d9&displaylang=en
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

772 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