Controlling Scheduling with a SQL Query

Revision as of 14:16, 8 August 2012 by Antonio.remedios (talk | contribs) (Created page with "From XLCubed v7.1, you can use a SQL query to populate the recipients of a scheduled report, and the parameters used when preparing the report itself. ==Preparing the SQL Statem...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

From XLCubed v7.1, you can use a SQL query to populate the recipients of a scheduled report, and the parameters used when preparing the report itself.

Preparing the SQL Statement

The SQL statement should return one row per report recipient, and columns configured like this:

Email Role Locale Parameter1 ... ParameterN
recipient1@example.org Role1 en-US Value1 ValueN
recipient2@example.org Role2 fr-FR Value1 ValueN
recipient3@example.org Role3 fr-FR Value1 ValueN
Email 
The email address for the recipient of the scheduled report
Role 
The database role to use when preparing the report
Locale 
The culture to use when preparing the report
Parameters 
Any Web Parameters to use to populate the report. See below for more information

Configuring the Distribution List to use the SQL Query

  • On the web server, open the distributionLists.xml configuration file, found in the __xlcubed__\__scheduling__ subfolder of the XLCubed Repository
  • To each dynamically populated distribution list add:
    1. a dbConnection element, containing the connection string to use to connect to the database. This can include the User Id and Password connection properties if appropriate
    2. a populateQuery element, containing the SQL statement to run
  • Your distributionLists.xml file should now contain an element that looks like this:
<distributionlist guid="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" name="List name">
  <dbConnection>Data Source=serverName\instance;Initial Catalog=DBName;User Id=Username;Password=ThePassword</dbConnection>
  <populateQuery>ap_GetSchedulingItems</populateQuery>
</distributionlist>

Populating Web Parameters

See Also