javascript
  • html
  • excel
  • sharepoint
  • 2014-07-24 23 views 0 likes 
    0

    我試圖通過一個按鈕打開2個報告,使我們的過程更快一點。如果我只在「onclick」事件中放置一個鏈接,但一旦我將它們放入其中一個時,一切都可以正常工作。通過一個按鈕導出2個報告

    這是我試過的。

    <script type="text/javascript"> 
    
         function itsa() 
         { 
          window.location.href='http://*******/****/******/*****/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List={*******************}&View={**********************}&CacheControl=1'; 
         } 
    
         function other() 
         { 
          window.location.href='http://*******/****/******/*****/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List={*******************}&View={**********************}&CacheControl=1'; 
         } 
    
         </script> 
    
    
         <div class="wrapper"> 
          <input type="button" style="width:180px; height: 75px; background:gray; color:white;font-size:larger; font-weight:bold; left: 214px;"onclick="itsa();other();" value ="Generate Excel report"/> 
         </div> 
    

    ,我也嘗試過

    <div class="wrapper"> 
          <input type="button" style="width:180px; height: 75px; background:gray; color:white;font-size:larger; font-weight:bold; left: 214px;"onclick=" window.location.href='http://*******/****/******/*****/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List={*******************}&View={**********************}&CacheControl=1'; window.location.href='http://*******/****/******/*****/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List={*******************}&View={**********************}&CacheControl=1';" value ="Generate Excel report"/> 
    </div> 
    

    任何想法?

    謝謝。

    回答

    1

    您需要在彈出窗口中打開每個報告。使用window.open("URL")而不是window.location.href來這樣做。

    +0

    不錯,工作:)謝謝! – Du6e

    相關問題