Difference between revisions of "Connection Mapping"

(Added information about SQL)
Line 1: Line 1:
 
XLCubed Web Edition supports the re-targeting of connections for reports published to the web server.
 
XLCubed Web Edition supports the re-targeting of connections for reports published to the web server.
  
To enable this feature, the {{Code|ConnectionMapping.xml}} file must be created in the {{Code|Xml}} subfolder of the XLCubed Web installation folder. This file can contain one or more {{Code|connectionmap}} nodes, each of which must contain a {{Code|from}} connection definition and a {{Code|to}} connection definition. After modifying this file, IIS must be restarted.
+
To enable this feature, the {{Code|ConnectionMapping.xml}} file must be created in the {{Code|Xml}} subfolder of the XLCubed Web installation folder. This file can contain:
 +
* one or more {{Code|connectionmap}} nodes (for cube connections) each of which must contain a {{Code|from}} connection definition and a {{Code|to}} connection definition
 +
* one or more {{Code|sqlconnectionmap}} nodes (for relational connections) each of which must contain a {{Code|match}} Regular Expression element and a {{Code|connectionstring}} to replace it
 +
After modifying this file, IIS must be restarted.
  
When a user loads a Report to view, the Web Edition will automatically search for any connections matching a {{Code|from}} definition, and replace them with the corresponding {{Code|to}} definition.
+
When a user loads a Report to view, the Web Edition will automatically search for any connections matching a {{Code|from}} or {{Code|match}} definition, and replace them with the corresponding definitions. For cube connections, the match is done using the Type, Server, Database and Cube of the {{Code|from}} connection.
 
 
The match is done using the Type, Server, Database and Cube of the from connection.
 
  
 
The ID number and name for the connection will be left unchanged.
 
The ID number and name for the connection will be left unchanged.
Line 11: Line 12:
 
==Example XML file==
 
==Example XML file==
  
''This example matches connections to the DEVELOPMENT server and replaces them with connections to the PRODUCTION server.''
+
''This example:
 +
* matches cube connections to the DEVELOPMENT server and replaces them with connections to the PRODUCTION server
 +
* matches SQL connections to any of the servers DEVELOPMENT1, DEVELOPMENT2 and DEVELOPMENT3 and replaces them with connections to the PRODUCTION server''
  
 
<pre>
 
<pre>
 
<?xml version="1.0" encoding="utf-8"?>
 
<?xml version="1.0" encoding="utf-8"?>
 
<connectionmapper>
 
<connectionmapper>
 +
 
   <connectionmap>
 
   <connectionmap>
 
     <from>
 
     <from>
Line 46: Line 50:
 
     </to>
 
     </to>
 
   </connectionmap>
 
   </connectionmap>
 +
 +
  <sqlconnectionmap>
 +
    <match>Provider=SQLOLEDB;Data Source=DEVELOPMENT[1-3];Initial Catalog=MyDatabase;Trusted_Connection=Yes</match>
 +
    <connectionstring>Provider=SQLOLEDB;Data Source=PRODUCTION;Initial Catalog=MyDatabase;Trusted_Connection=Yes</connectionstring>
 +
  </sqlconnectionmap>
 +
 
</connectionmapper>
 
</connectionmapper>
 
</pre>
 
</pre>
  
 
[[Category:Web Edition]]
 
[[Category:Web Edition]]

Revision as of 13:33, 13 August 2014

XLCubed Web Edition supports the re-targeting of connections for reports published to the web server.

To enable this feature, the ConnectionMapping.xml file must be created in the Xml subfolder of the XLCubed Web installation folder. This file can contain:

  • one or more connectionmap nodes (for cube connections) each of which must contain a from connection definition and a to connection definition
  • one or more sqlconnectionmap nodes (for relational connections) each of which must contain a match Regular Expression element and a connectionstring to replace it

After modifying this file, IIS must be restarted.

When a user loads a Report to view, the Web Edition will automatically search for any connections matching a from or match definition, and replace them with the corresponding definitions. For cube connections, the match is done using the Type, Server, Database and Cube of the from connection.

The ID number and name for the connection will be left unchanged.

Example XML file

This example:

  • matches cube connections to the DEVELOPMENT server and replaces them with connections to the PRODUCTION server
  • matches SQL connections to any of the servers DEVELOPMENT1, DEVELOPMENT2 and DEVELOPMENT3 and replaces them with connections to the PRODUCTION server
<?xml version="1.0" encoding="utf-8"?>
<connectionmapper>

  <connectionmap>
    <from>
      <connection id="0" name="">
        <type>AnalysisServices</type>
        <variable type="String" name="server"><value>DEVELOPMENT</value></variable>
        <variable type="String" name="database"><value>Demo Database</value></variable>
        <variable type="String" name="cube"><value>Demo Cube</value></variable>
        <writebacktype>AnalysisServices</writebacktype>
        <writebacksetting />
        <nodummyrelationalwriteback>0</nodummyrelationalwriteback>
        <variable type="Boolean" name="requirespassword"><value>0</value></variable>
        <lastconnected>0001-01-01T00:00:00</lastconnected>
        <props />
      </connection>
    </from>
    <to>
      <connection id="0" name="">
        <type>AnalysisServices</type>
        <variable type="String" name="server"><value>PRODUCTION</value></variable>
        <variable type="String" name="database"><value>Demo Database</value></variable>
        <variable type="String" name="cube"><value>Demo Cube</value></variable>
        <writebacktype>AnalysisServices</writebacktype>
        <writebacksetting />
        <nodummyrelationalwriteback>0</nodummyrelationalwriteback>
        <variable type="Boolean" name="requirespassword"><value>0</value></variable>
        <lastconnected>0001-01-01T00:00:00</lastconnected>
        <props />
      </connection>
    </to>
  </connectionmap>

  <sqlconnectionmap>
    <match>Provider=SQLOLEDB;Data Source=DEVELOPMENT[1-3];Initial Catalog=MyDatabase;Trusted_Connection=Yes</match>
    <connectionstring>Provider=SQLOLEDB;Data Source=PRODUCTION;Initial Catalog=MyDatabase;Trusted_Connection=Yes</connectionstring>
  </sqlconnectionmap>

</connectionmapper>