Report Engine Chris Leuer – Lead Software Engineer California Community College Solution Center SunGard Higher Education January 2010
California Community College Team Mike Agnew – General Manager of Solution Centers Mike Reid – Director TJ Baugus – Student Analyst Jan Wilder – Human Resources Analyst Chris Leuer – Lead Software Engineer Gladys Rocher – Senior Developer Moises Diaz – Developer Joel Rodriguez – Developer
Objectives Understand purpose and design of Report Engine Explore support considerations Learn how to create and customize Reports
Purpose Produce reports from Banner tables Allow flexible queries Normalize and transform data Store query results from relational database in XML Query results available in report form outside database
Solution Flexibility of Oracle XML DB allows us to store, transform and report any relational data Adheres to Extract, Transform, Load (ETL) methodology Is compatible with a multiple of reporting requirements. (MIS and more)
Why for MIS? Faster development and deployment of reports, than traditional programs Community College staff can alter queries to meet institutional needs A Banner integrated interface is provided to manage reports. MIS specific formatting provided by Banner job GVPREPT MIS requirements change overtime
Report Engine Implementation The engine generates a XML Document from a dynamic SQL statement The XML Document is saved into a XMLType Column in a table The XML Document is transformed and saved in XML DB Repository NOTE: You can now bypass the XML DB repository to save disk space and memory usage XMLType= a native oracle type of an XML document or XML fragment CLOB = very large character string in oracle WebDAV = a protocol so users can collaborate and edit web files (ie xml)
Why Oracle XML Native support for XML in the Oracle database Persistence models for XML Content URL-centric access to XML content Abstraction of data using native XML type Oracle support for XML includes XQUERY (SQL query of XML data), XML Schema (schemas are validated xml structure registered in Oracle), compatibility with PLSQL, Java, Pro*C and other languages, XPATH (resource method), DOM and much more !
relational data xml db repository extract transform run report jobsub output xmltype column
Terminology Report Element A unique identifier for the report defined the reports engine For example, we say that we are going to run report named “CALENDAR” Element After extract and transform steps are complete, an element is a named value in the notation: <LAST-NAME> James </LAST-NAME> We would consider naming our columns (ie <table>_snapshot> something different, but we do not like REPORT because The engine might be run to create an XML schema that is resourced for data transfer ie SOAP , FTP
How do I run a Report Reports are submitted in the background to run as Oracle jobs on GVAREPT GVAREPT generates the extract and transformed XML Banner job gvprept generates final MIS data file
Status button
Questions about overview Next – Support Considerations
Support considerations Report Engine (REPT) is required for California Baseline (CALB) REPT 7.5 is highest version available for Banner 7.x REPT 8.0 is highest version available for Banner 8.x Dependencies for releases can be found in the C3SC Interdependency matrix
Support from Actionline Log into the SGHE Customer Support Center. Current link is http://connect.sungardhe.com. For REPT problems, Product Line = Banner Product = General Module = SC California REPT Report Engine For MIS problems Product = Student (or General) Module = SC California CALB
Solution Center website http://confluence.sungardhe.com/display/solcentre/C3SC+Home
Documentation Documentation is available under custom files SC-California-CALB
Documentation
Report Engine (REPT) releases Version Features 7.3.1 initial release 7.3.2 introduced sequence number 7.3.3 add gvprepg, obsolete gvptran and gvpextr 7.4 copy feature, multiple parameters, defect correction 7.5 security integration, interface improvement, Oracle job 8.0 Banner 8.0 release
Dependencies
Install considerations REPT install creates REPTMGR schema No gostage. Check logs for any Oracle errors. Version table is RVRVERS Check for patches in SC-California-CALB section of custom files Source files are migrated to $BANNER_HOME/rept
FAQs FAQ 1-3SGP7Y < or > characters found in scbcrse_title result in error LPX-00210 for MIS CB report FAQ 1-4MTD7J Oracle jobs can conflict with poorly written auditing code FAQ 1-4OKYPV – work around for memory FAQ 1-4QPZDQ – space problem
Patches All patch data is inserted into gurpost All patch fixes are rolled into next release apply p_memory_rept70500 for REPT 7.5 Apply (1st) p_memory_rept80000 (2nd) p_rept_bund01_rept80000 for REPT 8.0 Other patches are available for O/S specific defects and forms issues
Security in REPT All reports defined in Report Engine validation table GVVRPDF need to be defined in Banner Security Use GUASECR (or) Report Engine security scripts REPT delivers one class BAN_REPT_C Users need the BAN_REPT_C class to run MIS reports Records are created in bansecr.GURUOBJ and bansecr.GURAOBJ tables for each report For custom classes, create bansecr.GURUOBJ and bansecr.GURAOBJ record Reports do not need defined as Banner objects in GUAOBJS
Utility Scripts File Name Description createresource.sql Creates directory path in XML DB Repository rept_secr_class_asgn.sql Insert MIS data into GURUOBJ rept_secr_roles_asgn.sql Insert MIS data into GURAOBJ
Setup Oracle job setup (7.5) JOB_QUEUE_PROCESSES=5 JOB_QUEUE_INTERVAL=60 (replaced by _job_queue_interval)
Common Issues Aborted upgrades , check CALB logs No background Oracle job processes Extract Query returns no results Missing MIS data , check CALB logs Oracle errors on transform, check user functions
Questions about support Next – how to create and customize reports
Creating Reports How to define a report How to code a report Improvements/Questions
Skill set Banner Report Engine interface Query language SQL Programming PL/SQL Minimal XML Knowledge of MIS data dictionary
Oracle XML Repository
Extract XML <STUDENT> <STUDENT_ROW> <First Name>Francois</First Name> <ID>210009406</ID> <Last Name>Pare</Last Name> <Street>18 Westward Way </Street> <ZIP_Code>19382 </ZIP Code> <State> PA </State> </STUDENT_ROW_> <First Name>Bob</First Name> <Last Name>Barker</Last Name> <Street>2457 Queens Way </Street> <ZIP_Code>19902 </ZIP Code> <State> NY </State> </STUDENT_ROW> </STUDENT> top element parent element child element Banner report name + row Banner report name
Transformed XML top element <STUDENT> <STUDENT_ROW> <Name>Francois Pare</Name> <Ident>210009406</Ident> <State>Pennsylvania</State> </STUDENT_ROW> <Name>Bob Barker</Name> <State>California</State> </STUDENT> parent element new child element Banner function element Banner direct element Banner map element
Transform elements Direct - direct element value to element value relationship Function - value derived from user created function Map - maps to value in mapping form GVATRMP A flat XML tree is a tree with one master root and one level of elements. We have not created a map table yet. We will try use RF’s map table. We will provide a pre-defined Map function.
direct example MIS element SB last name
map example MIS element SB11 Education level
Map example (cont) GVATRMP
function example MIS item SB00
Transform function -- support cursor in gv_mis_global_bp CURSOR Get_SPBPERS_C(p_pidm SPRIDEN.SPRIDEN_PIDM%TYPE) IS SELECT SPBPERS_SSN FROM SPBPERS WHERE SPBPERS_PIDM = p_pidm;
Function (cont) row of elements is a collection of element from extract parameter set has 1 parameter FUNCTION f_get_identifier(rowofelements IN rept_rowofelements) RETURN VARCHAR2 IS lv_extract_pidm gvbtrel.gvbtrel_element%TYPE := 'PIDM'; lv_pidm SPRIDEN.SPRIDEN_PIDM%TYPE; lv_extract_id gvbtrel.gvbtrel_element%TYPE := 'ID'; lv_id SPRIDEN.SPRIDEN_ID%TYPE; lv_ssn SPBPERS.SPBPERS_SSN%TYPE; ..
.. Function (cont) BEGIN -- find element PIDM lv_pidm :=gv_rept_xml.f_find_element_value_inrow(lv_extract_pidm, rowofelements); lv_id :=gv_rept_xml.f_find_element_value_inrow(lv_extract_id, ..
Function (cont) OPEN Get_SPBPERS_C(lv_pidm); FETCH Get_SPBPERS_C INTO lv_ssn; IF Get_SPBPERS_C%NOTFOUND OR lv_ssn IS NULL OR F_is_all_numeric(lv_ssn) = 'N' OR LENGTH(lv_ssn) <> 9 THEN CLOSE Get_SPBPERS_C; RETURN lv_id; ELSE RETURN lv_ssn; END IF; END f_get_identifier;
Banner map/function combo MIS element SB22 Academic Standing
GVATRMP
Use F_mapvalue() OPEN Get_SHRTTRM_C(lv_pidm,lv_term); FETCH Get_SHRTTRM_C INTO lv_cast_code; .. RETURN gv_rept_xml.F_MapValue(lv_report,'SB22',lv_cast_code);
How to create a report define report GVVRPDF create query GVARSQL define column mapping GVAMAPD define parameters GVAPDEF define final elements GVATREL Define any element maps GVATRMP Questions about forms?
APIs Reports can be executed by simple SQL scripts High-level packages core functionality gv_rept_engine_bp – top-level functions for extract and transform gv_rept_xml – XML operations gv_rept_job – Job status and submission
APIs- gv_rept_engine_bp package PROCEDURE p_extract( p_report gvvrpdf.gvvrpdf_report%TYPE, p_seqno IN NUMBER, p_message_out OUT VARCHAR2); PROCEDURE p_transform ( p_report IN gvvrpdf.gvvrpdf_report%TYPE, p_seqno IN NUMBER, p_xdb_pathname IN VARCHAR2, p_addattrib VARCHAR2 DEFAULT 'Y', p_message_out OUT VARCHAR2, p_printclob VARCHAR2 DEFAULT NULL, p_bypass_ind IN VARCHAR2 DEFAULT 'N');
API: example transform script set serveroutput on size 1000000 spool transform_xml.log begin gv_rept_xml.p_build_xml(p_report => 'CB', p_seqno => 1905); replace with your seqno -- gv_rept_xml.p_transform_xml( p_report => 'CB', p_seqno => 1905, --replace with your seqno p_xdb_pathname => '/public/calb/c3sc', --replace with your path p_addattrib => 'Y', p_do_print => 'N'); end; / spool off
Tips Always use COPY feature on GVVRPDF Copy existing CALB packages Must add Report to Banner security and FAQ Copy existing CALB packages ex: sv_mis_sx to sz_mis_sx Add a pidm to WHERE CLAUSE in GVARSQL for when missing data Run GVPREPG to purge old XML Run SQL script (calling gv_rept_engine) for full error
Improvements Function to return seqno and parameters found in GVBTRPR Delete capability Print parameters in control file Utility to concatenate MIS reports
End Question? Thanks for attending! Chris Leuer, SunGard chris.leuer@sungardhe.com