locked
How to open link from chrome browser to Internet Explorer in MVC RRS feed

  • Question

  • User-1893379617 posted
    Hi,
     
    I have links in view page. when i am running application in chrome browser,then When i click on link, it should always open in Inter Explorer browser instead of chrome browser.
    Please find my code in below. Report URL is the column contains links. When i click on link , it should always open in Internet Explorer.
    <table class="table table-hover">
        <thead>
            <tr>
               
                <th scope="col">Report Name</th>
                <th scope="col">Report URL</th>
              </tr>
        </thead>
        <tbody>
    @foreach (var row in Model)
    {
            <tr>
              
                <td>
                    @row.reportName
     
                </td> 
            
                
                <td><a href="@row.reportURL" target="_blank" >@row.reportURL</a></td>
     
                
            </tr>
     
     
    }
        </tbody>
              
    </table>
    Wednesday, June 26, 2019 6:50 AM

All replies

  • User-821857111 posted

    What you want to achieve is not possible. You cannot use MVC or Javascript to control which browser should be used when a link is clicked in a web page. 

    Wednesday, June 26, 2019 7:04 AM
  • User-1893379617 posted

    Hi,

    Thank you for quick reply. While i was doing R&D , i found some code. But i am not sure will it work or not.

    Can we use this way.

    function openURL() {
     var shell = new ActiveXObject("WScript.Shell");
    shell.run("IE http://www.google.com");
    }

    Wednesday, June 26, 2019 10:21 AM
  • User475983607 posted

    ActiveX is long gone in modern browsers and only support by IE ending with IE 11.

    Wednesday, June 26, 2019 11:33 AM
  • User-821857111 posted

    Hi,

    Thank you for quick reply. While i was doing R&D , i found some code. But i am not sure will it work or not.

    Can we use this way.

    function openURL() {
     var shell = new ActiveXObject("WScript.Shell");
    shell.run("IE http://www.google.com");
    }

    No. ActiveX is not supported in Chrome. As I said, what you want to achieve is not possible.

    Of more interest is the reason why you want to force the user to use IE. Does your web page rely on other technology that's only supported in IE? Perhaps if you explained the reason behind your question, someone might be able to suggest an alternative approach.

    Wednesday, June 26, 2019 11:49 AM
  • User-1893379617 posted

    Hi,

    Thank you for your information.

    I have SSRS reports link which i have shown in my UI. In some SSRS reports, i have Date field. if you run the report on chrome , the Date icon is not showing. Hence user facing issue to use chrome. When they run same SSSRS report on IE, Date icon is visible . User is able to click icon to select date field. This is the challenge am facing. If any one have answer for this, please reply. It will be great help for me. So i want when user run the application via chrome, and they click on SSRS report link, it should automatically redirect IE browser and open the link.

    Wednesday, June 26, 2019 2:07 PM
  • User753101303 posted

    Hi,

    Stricly speaking it could be done on fully controlled machines or maybe under Windows 10 (if I remember, there is a custom protocol handler that allows to switch to IE).

    I would rather spend my R&D on looking if  the site couldn't be upated to not require a particular browser.

    Wednesday, June 26, 2019 2:08 PM
  • User-1893379617 posted

    Hi,

    Could you please clarify more on this. I am not getting what you are trying say on this.

    Wednesday, June 26, 2019 2:14 PM
  • User475983607 posted

    kamalsekhar

    It will be great help for me. So i want when user run the application via chrome, and they click on SSRS report link, it should automatically redirect IE browser and open the link.

    kamalsekhar, your approach will NOT work.  Drop the current approach and move forward with a new approach.

    I recommend troubleshooting the Data Icon to figure out why it does not show in chrome.   Have you tried dev tools?

    Perhaps you need to upgrade your version of SSRS to work with Chrome?

    https://docs.microsoft.com/en-us/sql/reporting-services/browser-support-for-reporting-services-and-power-view?view=sql-server-2017

    If you are unable to upgrade SSRS or fix the Data icon, then alert your users to use IE.

    Wednesday, June 26, 2019 2:17 PM
  • User71929859 posted

    Hi,

    As already mentioned, this is not possible. If one particular feature is not compatible with a browser, what we usually do is display a message on the top saying some of the features would not work in this browser. You can use some JS code like below to target that out and just alert the user saying please use IE.

    https://stackoverflow.com/questions/4565112/javascript-how-to-find-out-if-the-user-browser-is-chrome/13348618#13348618

    This is what SharePoint is doing anyway. Some features only works in IE so they basically display a message to the user saying open this web page in IE. It's up to the user to open it in IE or not. Your web application can't and shouldn't open up applications in client PC. 

    Wednesday, June 26, 2019 9:59 PM
  • User753101303 posted

    I checked and saw actually that for Edge only : <a href="microsoft-edge:https://www.google.com/">Edge</a> should ask for opening this link in Edge.

    Which version of SSRS are you using ?I would really try to fix the actual problem.

    Thursday, June 27, 2019 6:49 AM
  • User-1893379617 posted

    Hi PatriceSc,

    Really, I would like to thank you so much for solution. Its working fine now.

    How to open in Internet explorer browser instead of Microsoft Edge ? 

    Update: Users are using windows 7 OS. They want to open URL in internet explorer . In windows 7 , microsoft -edge is not there. Please help me .

    Thursday, June 27, 2019 2:48 PM
  • User753101303 posted

    You would need to deploy your own custom protocol handler. I see also https://stackoverflow.com/questions/34276929/how-can-i-get-ssrs-and-chrome-to-work-together which suggest to use extensions.

    I wonder also if you couldn't make this work by updating browser config files used by ASP.NET. Which version of SSRS are you using ? My first move would be still to make 100% sure about the problem and maybe try to fix this.

    Friday, June 28, 2019 7:35 AM