开发者

embedding an excel document in an intranet browser, and navigate to a sheet

It would make my user's lives much easier if I could do the following;

  • Allow an Excel document to be viewed (not edited) in Internet Explorer 8

  • Facilitate jumping to particular sheets in that document

I can embed the Excel file using an iframe which works, but I am utterly stuck when it comes to jumping to a particular named worksheet in that document.

Is this possible? I'm thinking either some way to force the document to show a particular worksheet first, via the src attribute, or controlli开发者_StackOverflowng the embeded doc via javascript.


If you are serving XMLSS you can specify the ActiveSheet, ActiveRow, and ActiveCol. If you are using a third-party control, they usually have a way to set the active sheet and range. If you are serving a HTML table or cvs, you are out of luck.

  <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
   <ActiveSheet>1</ActiveSheet>
  </ExcelWorkbook>
  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   <Selected/>
   <Panes>
    <Pane>
     <Number>3</Number>
     <ActiveRow>16</ActiveRow>
     <ActiveCol>5</ActiveCol>
    </Pane>
   </Panes>
  </WorksheetOptions>


Have you tried the PHP excel reader? I used it for similar purposes once. http://sourceforge.net/projects/phpexcelreader/


I am not sure if you can do this with JavaScript. But another question. Do you generate this file on the server side? Then you could embed some macro which would jump to this partcular worksheet.


Thought of something. Use AJAX, post back when HTML element changes, re-serve the workbook with a modified open workbook macro that uses the post back data to display the proper worksheet and range. Since there is no browser refresh flash, the user may/will never notice. The only downside, is the round-trip back to the server.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜