Chapter 9. The Central Code Repository
One challenge that advanced users encounter with Interactive Reporting's
report-centric model is the tracking and maintenance of heavily customized dashboard
reports, especially in enterprise-level implementations where code is used repetitively
and transparently across multiple documents. Given the common and straightforward
practice of storing similar JavaScript code within each document in an enterprise, it is
incredibly difficult and infeasible to individually identify, track, and edit changes
across documents.
One simple and invaluable methodology is to store report customization scripts in an
accessible database table within the enterprise environment. This script table, referred
to as the Central Code Repository (CCR), is an
external reporting library that allows code to be quickly pushed into some or all
documents in an enterprise...
Understanding the Central Code Repository
The Central Code Repository (CCR) is a database model created for Hyperion
Interactive Reporting that allows the storage, management, and implementation of a
centralized code base. The repository is purely a custom developed database table or
set of database tables created by development and business users to effectively
leverage and maintain JavaScript code statements and variables across multiple
Interactive Reporting documents. The tables are maintained by the development and
user community, and the table must exist in a centralized location that is
accessible by the Interactive Reporting documents using code from the developed
solution. Below is a conceptual diagram of the use of the CCR across multiple
Interactive Reporting documents:
Changes made to the code database tables are efficiently managed within...
Configuring the CCR code table and query
With the report code now stored in the CCR code table in the database, BQY
documents can query the table and then evaluate the code that is stored in the
table. The image below shows the CCR workflow within the Interactive Reporting
document.
When the document is first opened, the query to retrieve the code from the CCR
code database is processed during the document start-up process. Once the query
results are retrieved, the results from the code column are then looped through the
JavaScript eval()
function to declare the functions and
variables or to execute code statements.
Note
Store any code statements commonly used in user interface modifications,
including hiding or unhiding toolbars, menus, and other interface components in
the CCR.
Querying the Central Code Repository (CCR)
Each Interactive...
Building the Global Code Dashboard
In order for any section of the Interactive Reporting document to access functions
stored in the CCR, the functions need to be globally declared as part of the
document start-up process. If the necessary code was directly assigned to the
document object's OnStartup
event, the code would be run
when the document was opened before any other actions were performed by the client.
While this would ensure the functions are declared before any report object attempts
to call them, code errors, such as an infinite for loop, will cause the document to
become unstable and irrevocably corrupt. To avoid this hazard, use the techniques
explained in Chapter 5, Building the Dashboard
Framework to alternatively mange the document start-up
processes.
Creating the Global Code Dashboard
Once the query is configured...
With an understanding of the concepts discussed and the demonstration of the
simple example, the following topics are ideas for how the Centralized Code
Repository can be enhanced in an enterprise implementation.
Different report types such as ad-hoc, dashboard, or canned typically have
vastly different business requirements that are addressed with code unique to
the report type. The addition of a Report Type column in the CCR code table and
a Report Type filter on the CCR Query section allows management of code within a
subsection of reports. This concept also lends well to creating sub-libraries by
a business unit to address differing functional requirements across user groups
in an enterprise implementation.
Enterprise Object Library
The idea behind an Enterprise Object Library is to prepare code and...
The goal of this chapter was to provide the developers and users of Interactive
Reporting with an approach to creating a Central Code Repository to programmatically
push code into Interactive Reporting documents. The chapter began with an
introduction to the concepts of the CCR, where the approach and configuration of the
repository and database tables were discussed. The chapter continued with a simple
example implementation, where the configuration of the query, dashboard, and code
was demonstrated to provide the steps to implement the repository in an environment.
Topics including best practices in code placement and error checking through the
Console Window were discussed to assist with reducing failures and troubleshooting
the implementation. Finally, advanced concepts for enhancing the CCR were introduced
to describe...