none
Detect if RSClient print ActiveX Control is installed on client machine

    Question

  • Hi ! I got this problem when the client may not have RSClient print ActiveX Control installed and security settings wil block it to download.
    I would like to have a Javascript code that will detect if RSClient Active X is installed or not.
    something similar to Flash detection.
    but the problem is that I dodn;t have a direct link to the Active X itself, in case the customer needs to download it and install it , as in the Flash scenario.
    did anyone got this problem before?
    --
    Tuesday, April 28, 2009 10:17 PM

Answers

  • Hi zdragon,

     

    You can use any of the following JavaScript to detect if the RSClientPrinit ActiveX control is installed on client machine:

     

    Solution1:

    function DetectActiveX()

     {

        try

    {

                       //The parameter of the method ActiveXObject is the name(ProgID) of the RSClientPrint control.

           var comActiveX = new ActiveXObject('RSClientPrint.RSClientPrint.2005');  

        }

        catch(e)

    {

                       return false; 

        }

        return true;

     }

     

    Solution2:

    //<CLSID>The CLSID of the RSClientPrint control</CLSID>

    //<functionName>Any function of the RSClientPrint control</ functionName >

    function detectPlugin(CLSID,functionName)//functionName

    {

     var pluginDiv=document.createElement("<span name=\"pluginDiv\"></span>");

     document.body.insertBefore(pluginDiv);

     pluginDiv.innerHTML='<object id="objectForDetectPlugin" classid="CLSID:'+CLSID+'">';

     try

     {

      if(eval("objectForDetectPlugin."+functionName)==undefined)

      {

      pluginDiv.removeNode(true);

      return false;

      }

      else

      {

      pluginDiv.removeNode(true);

      return true;

      }

     }

     catch(e)

     {

      return false;

     }

    }

    function DetectActiveX()

    {

    //41861299-EAB2-4DCC-986C-802AE12AC499 is the CLSID of RSClientPrint control.

     if(!detectPlugin("41861299-EAB2-4DCC-986C-802AE12AC499","MarginLeft"))

     {

            return false;

     }

     else

     {

           return true;

     }

     

    To get a direct link to the ActiveX, you can copy the RSClientPrint.cab from “<Install Driver>:\Program Files\Microsoft SQL Server\MSSQL.<X>\Reporting Services\ReportServer\bin” to any other your own web application. And then use the link http://<site>/<path>/RSClientPrint.cab to get the ActiveX.

     

    To get the ProgID or the CLSID of an ActiveX, we can use the tool oleview.

    1.       Get the tool from Window Resource Kits. We can download the Window Resource Kits from http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en. The tool oleview is in the resource kits.

    2.       Open the oleview, navigate to the “Object classes” à “Controls” à the ActiveX we want.

    3.       Click the ActiveX, and then the information of the ActiveX will be displayed in the right window. Get the ProgID or the CLSID from the information overview.

     

    If you want to install the RSClientPrint control manually, you can follow the article supplied by Maria:

    http://blogs.msdn.com/mariae/archive/2008/12/11/unable-to-load-client-print-control-after-install-a-service-pack-or-cumulative-update-of-sql-server-2005.aspx

     

    If you have any more questions, please feel free to ask.

     

    Thanks,

    Jin


    Jin Chen - MSFT
    • Marked as answer by zdragon Tuesday, May 05, 2009 2:49 PM
    Thursday, April 30, 2009 3:22 AM