是否可以在一本excel书中打开2个或更多SP列表视图?

时间:2014-07-25 13:48:16

标签: javascript excel sharepoint sharepoint-2010

我有一些js代码,它使按钮导出2个视图到excel(从主视图)。 当我点击按钮一切正常但它一次打开一个文件,在我打开第一个文件后,我得到一个从excel生成的弹出窗口(参见图片)。 我一直试图找到一个可以执行弹出窗口功能的功能。我试图在同一个工作簿中打开两个视图。有可能吗?

http://i.stack.imgur.com/fDaN2.png

Js code ..

<script type="text/javascript">         
        function itsa()
        {
            window.open("http://*********/***/*******/******/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List={******************************&View={***************************}&CacheControl=1");
        }

        function other()
        {
             window.open("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>

1 个答案:

答案 0 :(得分:0)

我能够回答我自己的问题..

<script type="text/javascript">

        function itsa() 
        {
            window.open("http://*********/***/*******/******/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List={******************************}&View={******************************}&CacheControl=1");
        }

        function other() 
        {
             window.open("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>

然后点击“现有工作表”弹出窗口。