0

I'm trying to open 2 reports through one button to make our process a little bit quicker. Everything works fine as soon if i only put one link in the "onclick" event but as soon as i put both of them in only one them opens.

This is what i tried.

<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>

and i also tried

<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>

Any ideas?

Thank you.

Du6e
  • 129
  • 1
  • 7

1 Answers1

1

You need to open up each report in a popup. Use window.open("URL") instead of window.location.href to do so.

Community
  • 1
  • 1
berrberr
  • 1,914
  • 11
  • 16