Solved

Formatting Excel via XML, possible... how?

Posted on 2003-10-31
4
473 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
[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
  • 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

Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

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…
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

710 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