Navigation:  Application Modules > Administration > Reports > Configuration >

Database Mappings

Previous pageReturn to chapter overviewNext page

This area is one of the more important areas for report configuration within EnergySteward.com . This is where actual database connection string information is stored to map between the various  databases which the reports can run against. Important note:  This is typically done by the system/database administrator.

 

Inside each Crystal report file contains existing database information (FROM information).  The report database mapping screens allow you to setup substitution mappings to a different database (the TO information).

 

When a report is run within EnergySteward.com, the reporting service (running in the background on a server) will go thru each of the databases setup in the Crystal report (FROM information). The server name, database name and owner in the report is matched first to these FROM values.  Once a FROM record is found through this matching process, then the TO information stored within this mappings area is substituted within the report, just before it is actually run by the report service.

 

The screen shot below shows the initial screen which lists out your available report environments (these are OPTION, but if defined, they must be grouped within an existing environment type):

 

AdminReportConfigDBList

 

Add Report DB Mapping  (button) - Click this button to add a new report database mapping entry.

 

View/Edit Grid Button (pencil) - Click this next to the applicable item in order to change the information about this report database mapping.

 

Delete Grid Button (red x) - Click this next to the applicable report  entry that you want to permanently delete. Important note: You will be presented with a confirmation ("Are you sure...?") dialog box prior to deletion.

 

AdminReportConfigDBDetail

Mapping Name -  This is where you can place any name you want to identify this mapping entry.  This name is NOT used during the course of the report server mapping.  It is here as a means for you to identify the entry you setup.  It is a required field.

 

FROM Server/ODBC -  If you are specifying an ODBC DSN then this is where you indicate the ODBC name.  If your reports use OLE/ADO then you will indicate the actual server name.  This is the name which is stored in the underlying reports (rpt files) which get published within EnergySteward.com.

 

FROM Owner -  With SQL Server this is normally 'dbo' (database owner object).  It is possible to have different owners on objects that you want to map.  If this is the case, then would specify the applicable owner name here.

 

FROM DB - This is the underlying database name which is stored in the report for this mapping.

 

Environment (pull down list box) - This is optional.  If you are setting up a mapping for a specific environment, then select the specific environment from the pull down list items.  Any environments setup on this screen will need to have already been defined within an existing report environment type.  If you leave this blank, then that means this is for the default environment.

 

TO Server/ODBC -  If you are specifying an ODBC DSN then this is where you indicate the target/substitution ODBC name.  If your reports use OLE/ADO then you will indicate the actual target/substitution server name.  This will dynamically replace the respective FROM information just before a given report is run for the given report request.

 

TO Owner -  With SQL Server this is normally 'dbo' (database owner object).  It is possible to have different owners on objects that you want to map.  If this is the case, then would specify the applicable owner name here for the target/substitution database.  This will dynamically replace the respective FROM information just before a given report is run for the given report request.

 

TO DB - This is the underlying database name which is to be used for the target/substitution database. This will dynamically replace the respective FROM information just before a given report is run for the given report request.

 

TO User ID - This represents the user id which is to be used to connect with when running a report.  Typically, this is read only access for all tables/views AND execute access for stored procedures.

 

TO Password - This represents the password to use for the target/substitution connection.

 

An Example (In the example screen shot above... Here is what happens when a report is submitted...)

 

1.User submits a report thru the menus within EnergySteward.com.
2.The report request is written in a 'Submitted' status in a report queue (database table record entry).
3.The background report service polls every 60 seconds for 'Submitted' reports in the queue, picks up this request to process.
4.The report service finds the applicable 'RPT' file and stores a temporary copy to a temporary folder for execution.
5.The report service then scans the contents of the report looking for all tables, views/ procedures (for each subreport as well).
6.For each database object it finds it pulls out the FROM information (server/odbc, owner & database name).
7.It then looks into this mapping table to find a match for an entry matching all of the FROM items (if report submitted toward a specific environment it will use that to find the correct mapping record).
8.When it finds this DB mapping record, it then takes the all the TO information and swaps out the FROM information in the temporary copy.
9.The report server then runs the report with the TO mapped items, connecting to the database with the TO credentials listed above.  Report item gets marked as 'Running' in the queue.
10.The report completes the requests, writes out the report to applicable target location and marks the report as 'Completed'.  At which point it is viewable, etc.

 

The above list should assist in understanding how not only the database mapping entries get used but also how the report server for EnergySteward.com operates.  This design allows for the reusability of all reports to any liked schemas on/across any network within the same application environment.