我想问个问题;就是我的报表是在服务器端生成的excel 然后我用浏览器打开了这个excel;但是现在我想直接调用客户端的excel应用程序打开我服务器上的生成的excel 那位知道告诉我

解决方案 »

  1.   

    如果是在局域网内,可以用远程打开的方式,打开的文件地址写成  http://虚拟目录/文件相对地址。
      

  2.   

    http://虚拟目录/文件相对地址  这个可以!
      

  3.   

    生成excel文件后,用Response.WriteFile把文件输出到客户端,客户保存然后就可以直接打开了!
      

  4.   

    大哥们我不想用ie打开 我想用客户端excel应用程序打开我服务器上的.xls文件
      

  5.   

    <input type="hidden" name="out_word" onclick="vbscript:buildDoc" value="导出到word" class="notPrint"> 
    <input type="hidden" name="out_excel" onclick="AutomateExcel();" value="导出到excel" class="notPrint"> <title>浏览器表格导出到Excel代码</title>
    <input type="button" name="out_word" onclick="vbscript:buildDoc" value="导出到word" class="notPrint"> 
    <input type="button" name="out_word1" onclick="javascript:AutomateExcel() " value="导出到excel" class="notPrint"> 
    <table id="data" width="200" border="1">
      <tr>
        <td>11</td>
        <td>11</td>
      </tr>
      <tr>
        <td>22</td>
        <td>22</td>
      </tr>
      <tr>
        <td>33</td>
        <td>33</td>
      </tr>
      <tr>
        <td>44 </td>
        <td>44</td>
      </tr>
    </table>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function AutomateExcel() 
    {
    // Start Excel and get Application object.
    var oXL = new ActiveXObject("Excel.Application"); 
    // Get a new workbook.
    var oWB = oXL.Workbooks.Add();
    var oSheet = oWB.ActiveSheet;
    var table = document.all.data; 
    var hang = table.rows.length;var lie = table.rows(0).cells.length; // Add table headers going cell by cell.
    for (i=0;i<hang;i++)
    {
    for (j=0;j<lie;j++)
    {
    oSheet.Cells(i+1,j+1).Value = table.rows(i).cells(j).innerText;
    }}
    oXL.Visible = true;
    oXL.UserControl = true;
    }
    //-->
    </SCRIPT>
      

  6.   

    如果客户端安装了excel,那么总是在IE中打开的,除非你下载到本地,然后再打开:)
      

  7.   

    就像大家在做excel的时候 在文件->打开->然后输入一个url 一样
      

  8.   

    public void openfile(string filename)
    {
    Object Nothing=System.Reflection.Missing.Value;
    wb=app.Workbooks.Open("d://50269_EmployeeResume.xls",Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing);  

    Excel.Worksheet xSheet=(Excel.Worksheet)wb.Worksheets[1];
    this.app.Visible=true;
    // this._FileName=FileName;
    }
      

  9.   

    你的文件现在的地址是d://50269_EmployeeResume.xls
    把它放到你的Web文件夹里,然后把上面的地址改成http://虚拟目录/文件相对地址+文件名。 在web上,就是ie调用客户端excel应用程序,打开服务器上的.xls文件
      

  10.   

    那还不是用ie调用excel吗 我是想直接用excel打开
      

  11.   

    生成excel文件后,用Response.WriteFile把文件输出到客户端,客户保存然后就可以直接打开了!
    这个办法还是不错的