Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Thanks John - tis is a really useful example - particularly as I can never find the right CLSID's when I need them.

You can make this example a little more general by embedding a 2002 object inside a 2003 object - which means you can send it to a client browser without needing them to pick the version.

The browser will then cascade to the one it can handle. (Although you have to send the data twice.)

64 # Insert the ExcelXML code into a Html doc using a simple temp +late. 65 # Use HTML::Template or the Template::Toolkit for real applica +tions. 66 # 67 my $clsid2002 = "CLSID:0002E541-0000-0000-C000-000000000046" ; 68 my $clsid2003 = "CLSID:0002E559-0000-0000-C000-000000000046" ; 69 70 my $template = do {local $/; <DATA>}; 71 $template =~ s/__EXCEL_XML_DATA__/$xml_str/g; 72 $template =~ s/__SPREADSHEET_CLSID2002__/$clsid2002/; 73 $template =~ s/__SPREADSHEET_CLSID2003__/$clsid2003/; 74 75 print $template; 76 77 78 79 __END__ 80 Content-type: text/html 81 82 83 <html xmlns:o="urn:schemas-microsoft-com:office:office" 84 xmlns:x="urn:schemas-microsoft-com:office:excel" 85 xmlns=""> 86 87 <body> 88 <div id="Spreadsheet" align=center x:publishsource="Ex +cel"> 89 <object id="Spreadsheet" classid="__SPREADSHEET_CL +SID2003__"> 90 <param name=DisplayTitleBar value=false> 91 <param name=Autofit value=true> 92 <param name=DataType value=XMLData> 93 <param name=XMLData value="__EXCEL_XML_DATA__ +"> 94 <object id="Spreadsheet" classid="__SPREADSHEET_CL +SID2002__"> 95 <param name=DisplayTitleBar value=false> 96 <param name=Autofit value=true> 97 <param name=DataType value=XMLData> 98 <param name=XMLData value="__EXCEL_XML_DATA__ +"> 99 <p> 100 To use this Web page interactively, you mu +st have Microsoft Internet Explorer 5.01 Service Pack 2 (SP2) or late +r and the Correct V ersion of Microsoft Office Web Components. 101 </p> 102 <p> 103 See the <a href=";p1=Excel"> 104 Microsoft Office Web site</a> for more inf +ormation. 105 </p> 106 </object> 107 </object> 108 </div> 109 </body> 110 </html>

In reply to Re: Create an interactive Excel web page by Anonymous Monk
in thread Create an interactive Excel web page by jmcnamara

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (5)
    As of 2020-01-25 01:59 GMT
    Find Nodes?
      Voting Booth?