<?xml version="1.0" encoding="utf-8"?>
<Report Location="Local or Network Folders" Host="FINDITEZ-T460P" Path="C:\Users\ken\Documents\Test Cases\Oracle-Reports\StrategySummary.xml">
	<Group Name="">
		<Group Name="Data Sources">
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_TITLE]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[strategy_title]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Title]]></Property>
					<Property Name="Expression:"><![CDATA[bs.title]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[strat_rs]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Reporting Status1]]></Property>
					<Property Name="Expression:"><![CDATA[rs.status]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[strat_rs_comments]]></Property>
					<Property Name="Data Type:"><![CDATA[clob]]></Property>
					<Property Name="Label:"><![CDATA[Reporting Status Comments1]]></Property>
					<Property Name="Expression:"><![CDATA[rs.overall_comment]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[strat_status]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Status]]></Property>
					<Property Name="Expression:"><![CDATA[st.title]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[BUSINESS_NUMBER]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Business Number]]></Property>
					<Property Name="Expression:"><![CDATA[bs.business_number]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[strat_desc]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Description]]></Property>
					<Property Name="Expression:"><![CDATA[bs.description]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[START_DATE]]></Property>
					<Property Name="Data Type:"><![CDATA[character]]></Property>
					<Property Name="Label:"><![CDATA[Start Date]]></Property>
					<Property Name="Expression:"><![CDATA[bs.start_date]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[END_DATE]]></Property>
					<Property Name="Data Type:"><![CDATA[character]]></Property>
					<Property Name="Label:"><![CDATA[End Date]]></Property>
					<Property Name="Expression:"><![CDATA[bs.end_date]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[ID]]></Property>
					<Property Name="Label:"><![CDATA[Id]]></Property>
					<Property Name="Expression:"><![CDATA[bs.id]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[STATUS_ID]]></Property>
					<Property Name="Label:"><![CDATA[Status Id]]></Property>
					<Property Name="Expression:"><![CDATA[bs.status_id]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[TARGET_ID]]></Property>
					<Property Name="Label:"><![CDATA[Target Id]]></Property>
					<Property Name="Expression:"><![CDATA[bs.target_id]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[OWNER_UNIT_ID]]></Property>
					<Property Name="Label:"><![CDATA[Owner Unit Id]]></Property>
					<Property Name="Expression:"><![CDATA[bs.owner_unit_id]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[CREATE_BY_ID]]></Property>
					<Property Name="Label:"><![CDATA[Create By Id]]></Property>
					<Property Name="Expression:"><![CDATA[bs.create_by_id]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[CREATE_DATE]]></Property>
					<Property Name="Data Type:"><![CDATA[character]]></Property>
					<Property Name="Label:"><![CDATA[Create Date]]></Property>
					<Property Name="Expression:"><![CDATA[bs.create_date]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[UPDATE_BY_ID]]></Property>
					<Property Name="Label:"><![CDATA[Update By Id]]></Property>
					<Property Name="Expression:"><![CDATA[bs.update_by_id]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[UPDATE_DATE]]></Property>
					<Property Name="Data Type:"><![CDATA[character]]></Property>
					<Property Name="Label:"><![CDATA[Update Date]]></Property>
					<Property Name="Expression:"><![CDATA[bs.update_date]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[target1]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Target1]]></Property>
					<Property Name="Expression:"><![CDATA[tr.title]]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_Objectives]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[st_objective]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[St Objective]]></Property>
					<Property Name="Expression:"><![CDATA[BA_STRATEGY_OBJECTIVE.TITLE]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[STRATEGY_ID]]></Property>
					<Property Name="Label:"><![CDATA[Strategy Id]]></Property>
					<Property Name="Expression:"><![CDATA[BA_STRATEGY_OBJECTIVE.STRATEGY_ID]]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_UNIT_ID]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[ACRONYM]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Acronym]]></Property>
					<Property Name="Expression:"><![CDATA[u.acronym]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[unit_name]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Dn]]></Property>
					<Property Name="Expression:"><![CDATA[reports_pkg.GETENTIREUNITPATH ( U.ID , reports_pkg.getUnitLastName ( u.id ) )]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[u_strat]]></Property>
					<Property Name="Label:"><![CDATA[Strategy Id1]]></Property>
					<Property Name="Expression:"><![CDATA[bsu.strategy_id]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[UNIT_ID]]></Property>
					<Property Name="Label:"><![CDATA[Unit Id]]></Property>
					<Property Name="Expression:"><![CDATA[bsu.unit_id]]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_MEASURE_TYPE]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[measure_type]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Measure Type]]></Property>
					<Property Name="Expression:"><![CDATA[decode ( m_type.value_id , 2 , 'Rollup Measures' , 3 , 'Rollup Measures' , 'Measures' )]]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_MEASURE_DATA]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[measurement_id]]></Property>
					<Property Name="Label:"><![CDATA[Id1]]></Property>
					<Property Name="Expression:"><![CDATA[mm.id]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[meas_title]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Measure]]></Property>
					<Property Name="Expression:"><![CDATA[mm.title]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[meas_type]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Type]]></Property>
					<Property Name="Expression:"><![CDATA[m_utyp.title]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[measure_unit]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Unit]]></Property>
					<Property Name="Expression:"><![CDATA[mm.measure_unit]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[meas_freq]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Frequency]]></Property>
					<Property Name="Expression:"><![CDATA[m_freq.title]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[meas_status]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Status]]></Property>
					<Property Name="Expression:"><![CDATA[m_stat.title]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[meas_strategy]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Meas Strategy]]></Property>
					<Property Name="Expression:"><![CDATA[mber.object_id]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[measure_number]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Measure Number]]></Property>
					<Property Name="Expression:"><![CDATA[mm.business_id]]></Property>
				</Group>
				<Group Name="Formula:">
					<Property Name="Formula:"><![CDATA[CF_DATA_VALUES]]></Property>
					<Property Name="Data-Type:"><![CDATA[character]]></Property>
					<Property Name="Source:"><![CDATA[cf_data_valuesformula]]></Property>
				</Group>
				<Group Name="Formula:">
					<Property Name="Formula:"><![CDATA[CF_GRAPH_SUBTITLE]]></Property>
					<Property Name="Data-Type:"><![CDATA[character]]></Property>
					<Property Name="Source:"><![CDATA[cf_graph_subtitle_textformula]]></Property>
				</Group>
				<Group Name="Formula:">
					<Property Name="Formula:"><![CDATA[CF_GRAPH_TITLE_TEXT]]></Property>
					<Property Name="Data-Type:"><![CDATA[character]]></Property>
					<Property Name="Source:"><![CDATA[cf_graph_title_textformula]]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_RELATED_FILE_DETAILS]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[file_number]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Business Number1]]></Property>
					<Property Name="Expression:"><![CDATA[f.business_number]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[file_name]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Title]]></Property>
					<Property Name="Expression:"><![CDATA[f.title]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[file_status]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Rec Status]]></Property>
					<Property Name="Expression:"><![CDATA[rec_stat.title]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[file_reporting_status]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Reporting Status]]></Property>
					<Property Name="Expression:"><![CDATA[reporting_status.status]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[file_reporting_status_comment]]></Property>
					<Property Name="Data Type:"><![CDATA[clob]]></Property>
					<Property Name="Label:"><![CDATA[Reporting Status Comment]]></Property>
					<Property Name="Expression:"><![CDATA[reporting_status.overall_comment]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[file_id]]></Property>
					<Property Name="Label:"><![CDATA[File Id]]></Property>
					<Property Name="Expression:"><![CDATA[f.id]]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_file_division]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[file_division]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[File Division]]></Property>
					<Property Name="Expression:"><![CDATA[units.file_division]]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_DOC_dummy]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[dummy_field]]></Property>
					<Property Name="Data Type:"><![CDATA[character]]></Property>
					<Property Name="Label:"><![CDATA[Dummy Field]]></Property>
					<Property Name="Expression:"><![CDATA['Documents:']]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_Doc_Folder]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[co_docname]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Co Docname]]></Property>
					<Property Name="Expression:"><![CDATA[doc.co_docname]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[doc_date]]></Property>
					<Property Name="Data Type:"><![CDATA[date]]></Property>
					<Property Name="Label:"><![CDATA[Doc Date]]></Property>
					<Property Name="Expression:"><![CDATA[to_date ( co_docdate , 'MM/DD/YY HH:MI AM' )]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[doc_pkg_templ_name]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Doc Pkg Templ Name]]></Property>
					<Property Name="Expression:"><![CDATA[cm.co_menutext]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[doc_sub_id]]></Property>
					<Property Name="Label:"><![CDATA[Doc Sub Id]]></Property>
					<Property Name="Expression:"><![CDATA[: id]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[doc_type_title]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Doc Type Title]]></Property>
					<Property Name="Expression:"><![CDATA[dt.title]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[co_version]]></Property>
					<Property Name="Label:"><![CDATA[Co Version]]></Property>
					<Property Name="Expression:"><![CDATA[vrsn.co_version]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[doc_id]]></Property>
					<Property Name="Label:"><![CDATA[Doc Id]]></Property>
					<Property Name="Expression:"><![CDATA[doc.co_docid]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[doc_creator]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Doc Creator]]></Property>
					<Property Name="Expression:"><![CDATA[co_sourceauthor]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[co_filename]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Co Filename]]></Property>
					<Property Name="Expression:"><![CDATA[vrsn.co_filename]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[doc_desc]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Doc Desc]]></Property>
					<Property Name="Expression:"><![CDATA[doc.co_description]]></Property>
				</Group>
				<Group Name="Formula:">
					<Property Name="Formula:"><![CDATA[CF_doc_desc_decrypt]]></Property>
					<Property Name="Data-Type:"><![CDATA[character]]></Property>
					<Property Name="Source:"><![CDATA[cf_doc_desc_decryptformula]]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_cont_units]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[sort_id]]></Property>
					<Property Name="Label:"><![CDATA[Sort Id]]></Property>
					<Property Name="Expression:"><![CDATA[DECODE ( u.ministry_id , : P_MIN_ID , - 999 , ABS ( u.ministry_id ) )]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[Contact_Portf_Ministry]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Contact Portf Ministry]]></Property>
					<Property Name="Expression:"><![CDATA[reports_pkg.GETUNITLASTNAME ( u.ministry_id )]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[cont_object_id]]></Property>
					<Property Name="Label:"><![CDATA[Cont Object Id]]></Property>
					<Property Name="Expression:"><![CDATA[cp.object_id]]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_cont_teams]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[cont_team_title]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Cont Team Title]]></Property>
					<Property Name="Expression:"><![CDATA[ct.title]]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_cont_roles]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[cont_role_title]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Cont Role Title]]></Property>
					<Property Name="Expression:"><![CDATA[cr.title]]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_contacts]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[cont_name]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Cont Name]]></Property>
					<Property Name="Expression:"><![CDATA[i.first_name || ' ' || i.last_name]]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_gr_record_date]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[gr_record_date]]></Property>
					<Property Name="Data Type:"><![CDATA[date]]></Property>
					<Property Name="Label:"><![CDATA[Gr Record Date]]></Property>
					<Property Name="Expression:"><![CDATA[a.record_date]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[gr_target_value]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Gr Target Value]]></Property>
					<Property Name="Expression:"><![CDATA[MIN ( to_char ( a.target_value ) || DECODE ( a.high_value , 0 , '' , ' - ' || to_char ( a.high_value ) ) )]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[gr_actual_value]]></Property>
					<Property Name="Label:"><![CDATA[Gr Actual Value]]></Property>
					<Property Name="Expression:"><![CDATA[sum ( a.period_value )]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[gr_total_to_date]]></Property>
					<Property Name="Label:"><![CDATA[Gr Total To Date]]></Property>
					<Property Name="Expression:"><![CDATA[sum ( a.total_value )]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[raw_data_measure_id]]></Property>
					<Property Name="Label:"><![CDATA[Raw Data Measure Id]]></Property>
					<Property Name="Expression:"><![CDATA[: measurement_id]]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_graph_measure_id]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[graph_measure_id]]></Property>
					<Property Name="Label:"><![CDATA[Graph Measure Id]]></Property>
					<Property Name="Expression:"><![CDATA[a.MEASURE_ID]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[graphing_id1]]></Property>
					<Property Name="Label:"><![CDATA[Graphing Id]]></Property>
					<Property Name="Expression:"><![CDATA[a.id]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[system_or_user_generated]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[System Or User Generated]]></Property>
					<Property Name="Expression:"><![CDATA[vl.title]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[STATEMENT_OF_RESULT]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Statement Of Result]]></Property>
					<Property Name="Expression:"><![CDATA[TP.STATEMENT_OF_RESULT]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[co_docid]]></Property>
					<Property Name="Label:"><![CDATA[Co Docid]]></Property>
					<Property Name="Expression:"><![CDATA[image_source.co_docid]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[co_versioncomment]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Co Versioncomment]]></Property>
					<Property Name="Expression:"><![CDATA[image_source.co_versioncomment]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[co_filecontent]]></Property>
					<Property Name="Data Type:"><![CDATA[blob]]></Property>
					<Property Name="Label:"><![CDATA[Co Filecontent]]></Property>
					<Property Name="Expression:"><![CDATA[image_source.co_filecontent]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[Line_or_Bar]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Line Or Bar]]></Property>
					<Property Name="Expression:"><![CDATA[graph_type_nt.Line_or_Bar]]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_measurements_set_name]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[measurements_set_name]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Measurements Set Name]]></Property>
					<Property Name="Expression:"><![CDATA[a.title]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[rownum]]></Property>
					<Property Name="Label:"><![CDATA[Rownum]]></Property>
					<Property Name="Expression:"><![CDATA[rownum]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[graphing_id]]></Property>
					<Property Name="Label:"><![CDATA[Graphing Id1]]></Property>
					<Property Name="Expression:"><![CDATA[a.id]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[legend_measure_id]]></Property>
					<Property Name="Label:"><![CDATA[Legend Measure Id]]></Property>
					<Property Name="Expression:"><![CDATA[measure_id]]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_GRAPHING_ID2]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[TARGET_HIGH_VALUE]]></Property>
					<Property Name="Label:"><![CDATA[Target High Value]]></Property>
					<Property Name="Expression:"><![CDATA[gv.TARGET_HIGH_VALUE]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[GRAPHING_ID2]]></Property>
					<Property Name="Label:"><![CDATA[Graphing Id2]]></Property>
					<Property Name="Expression:"><![CDATA[gv.graphing_id]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[x_axis_value]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[X Axis Value]]></Property>
					<Property Name="Expression:"><![CDATA[gv.label]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[ACTUAL_VALUE1]]></Property>
					<Property Name="Label:"><![CDATA[Actual Value1]]></Property>
					<Property Name="Expression:"><![CDATA[gv.measure_value]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[TARGET_VALUE1]]></Property>
					<Property Name="Label:"><![CDATA[Target Value1]]></Property>
					<Property Name="Expression:"><![CDATA[gv.target_value]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[graphing_measure_id]]></Property>
					<Property Name="Label:"><![CDATA[Graphing Measure Id]]></Property>
					<Property Name="Expression:"><![CDATA[g.measure_id]]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_Attribute]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[chart_data_id]]></Property>
					<Property Name="Label:"><![CDATA[Chart Data Id]]></Property>
					<Property Name="Expression:"><![CDATA[c.chart_data_id]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[chart_title]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Chart Title]]></Property>
					<Property Name="Expression:"><![CDATA[c.title]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[chart_header]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Chart Header]]></Property>
					<Property Name="Expression:"><![CDATA[c.header]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[chart_footer]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Chart Footer]]></Property>
					<Property Name="Expression:"><![CDATA[c.footer]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[chart_start_dt]]></Property>
					<Property Name="Data Type:"><![CDATA[date]]></Property>
					<Property Name="Label:"><![CDATA[Chart Start Dt]]></Property>
					<Property Name="Expression:"><![CDATA[c.period_start]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[chart_end_dt]]></Property>
					<Property Name="Data Type:"><![CDATA[date]]></Property>
					<Property Name="Label:"><![CDATA[Chart End Dt]]></Property>
					<Property Name="Expression:"><![CDATA[c.period_end]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[freq_title]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Freq Title]]></Property>
					<Property Name="Expression:"><![CDATA[freq.freq_title]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[chart_description]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Chart Description]]></Property>
					<Property Name="Expression:"><![CDATA[c.description]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[chart_data_source]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Chart Data Source]]></Property>
					<Property Name="Expression:"><![CDATA[c.data_source]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[chart_reporting_status]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Chart Reporting Status]]></Property>
					<Property Name="Expression:"><![CDATA[rs.status]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[chart_rep_status_comment]]></Property>
					<Property Name="Data Type:"><![CDATA[clob]]></Property>
					<Property Name="Label:"><![CDATA[Chart Rep Status Comment]]></Property>
					<Property Name="Expression:"><![CDATA[rs.overall_comment]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[chart_parent_id]]></Property>
					<Property Name="Label:"><![CDATA[Chart Parent Id]]></Property>
					<Property Name="Expression:"><![CDATA[parent.chart_parent_id]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[sub_domain_id]]></Property>
					<Property Name="Label:"><![CDATA[Sub Domain Id]]></Property>
					<Property Name="Expression:"><![CDATA[parent.sub_domain_id]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[basic_chart_id]]></Property>
					<Property Name="Label:"><![CDATA[Basic Chart Id]]></Property>
					<Property Name="Expression:"><![CDATA[c.id]]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_Scope_Header]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[category_scope]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Category Scope]]></Property>
					<Property Name="Expression:"><![CDATA[DECODE ( SUBSTR ( upper ( category_scope.title ) , 1 , 3 ) , 'OPS' , '1OPS-Wide Management Categories' , 'MIN' , '2' || : CP_Ministry_Acronym || '-Specific Management Categories' , '3Division-Specific Management Categories' ) || ':']]></Property>
				</Group>
				<Group Name="Formula:">
					<Property Name="Formula:"><![CDATA[CF_Actual_Category_Scope]]></Property>
					<Property Name="Data-Type:"><![CDATA[character]]></Property>
					<Property Name="Label:"><![CDATA[Cf Actual Category Scope]]></Property>
					<Property Name="Source:"><![CDATA[cf_actual_category_scopeformul]]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_category_title]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[category_title]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Category Title]]></Property>
					<Property Name="Expression:"><![CDATA[mc.TITLE]]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_category_scope]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[cat_hierarchy_title]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Cat Hierarchy Title]]></Property>
					<Property Name="Expression:"><![CDATA[LPAD ( ' ' , ( LEVEL - 1 ) * 7 ) || lpad ( lvel.TITLE , 20 )]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[sub_categories_tree]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Sub Categories Tree]]></Property>
					<Property Name="Expression:"><![CDATA[value.title]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[sort_by_scope]]></Property>
					<Property Name="Label:"><![CDATA[Sort By Scope]]></Property>
					<Property Name="Expression:"><![CDATA[DECODE ( SUBSTR ( UPPER ( category_scope.title ) , 1 , 3 ) , 'OPS' , 1 , 'MIN' , 2 , 3 )]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[value_id]]></Property>
					<Property Name="Label:"><![CDATA[Id1]]></Property>
					<Property Name="Expression:"><![CDATA[value.id]]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_hierarchy_level]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[hierarchy_level]]></Property>
					<Property Name="Label:"><![CDATA[Hierarchy Level]]></Property>
					<Property Name="Expression:"><![CDATA[lvel.hierarchy_level]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[hierarchy_title]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Hierarchy Title]]></Property>
					<Property Name="Expression:"><![CDATA[lvel.title]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[hierarchy_tree]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Hierarchy Tree]]></Property>
					<Property Name="Expression:"><![CDATA[LPAD ( ' ' , ( LEVEL - 1 ) * 7 ) || lpad ( value.TITLE , 20 )]]></Property>
				</Group>
			</Group>
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[G_built_chart_id]]></Property>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[data_chart_id]]></Property>
					<Property Name="Label:"><![CDATA[Built Chart Id]]></Property>
					<Property Name="Expression:"><![CDATA[: chart_data_id]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[chart_row_number]]></Property>
					<Property Name="Label:"><![CDATA[Built Row Number]]></Property>
					<Property Name="Expression:"><![CDATA[r.row_number]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[col1]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Col1]]></Property>
					<Property Name="Expression:"><![CDATA[min ( decode ( ac.column_number , 0 , ac.data , null ) )]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[col2]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Col2]]></Property>
					<Property Name="Expression:"><![CDATA[min ( decode ( ac.column_number , 1 , ac.data , null ) )]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[col3]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Col3]]></Property>
					<Property Name="Expression:"><![CDATA[min ( decode ( ac.column_number , 2 , ac.data , null ) )]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[col4]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Col4]]></Property>
					<Property Name="Expression:"><![CDATA[min ( decode ( ac.column_number , 3 , ac.data , null ) )]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[col5]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Col5]]></Property>
					<Property Name="Expression:"><![CDATA[min ( decode ( ac.column_number , 4 , ac.data , null ) )]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[col6]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Col6]]></Property>
					<Property Name="Expression:"><![CDATA[min ( decode ( ac.column_number , 5 , ac.data , null ) )]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[col7]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Col7]]></Property>
					<Property Name="Expression:"><![CDATA[min ( decode ( ac.column_number , 6 , ac.data , null ) )]]></Property>
				</Group>
				<Group Name="Data Item:">
					<Property Name="Data Item:"><![CDATA[col8]]></Property>
					<Property Name="Data Type:"><![CDATA[vchar2]]></Property>
					<Property Name="Label:"><![CDATA[Col8]]></Property>
					<Property Name="Expression:"><![CDATA[min ( decode ( ac.column_number , 7 , ac.data , null ) )]]></Property>
				</Group>
			</Group>
		</Group>
		<Group Name="Report Parameters">
			<Group Name="Parameter:">
				<Property Name="Parameter:"><![CDATA[P_MIN_ID]]></Property>
				<Property Name="Data Type:"><![CDATA[number]]></Property>
				<Property Name="Initial Values:"><![CDATA[47]]></Property>
			</Group>
			<Group Name="Parameter:">
				<Property Name="Parameter:"><![CDATA[P_OBJECT_ID]]></Property>
				<Property Name="Data Type:"><![CDATA[number]]></Property>
				<Property Name="Initial Values:"><![CDATA[381]]></Property>
			</Group>
			<Group Name="Parameter:">
				<Property Name="Parameter:"><![CDATA[P_SESSION_ID]]></Property>
				<Property Name="Data Type:"><![CDATA[character]]></Property>
				<Property Name="Initial Values:"><![CDATA[1239115823999]]></Property>
			</Group>
			<Group Name="Parameter:">
				<Property Name="Parameter:"><![CDATA[P_REPORT_VALID_SET_ID]]></Property>
				<Property Name="Data Type:"><![CDATA[character]]></Property>
				<Property Name="Initial Values:"><![CDATA[11911]]></Property>
			</Group>
		</Group>
		<Group Name="Tables">
			<Group Name="Table:">
				<Property Name="Table:"><![CDATA[Q_STRATEGY]]></Property>
				<Property Name="SQL Command:"><![CDATA[SELECT 
  bs.id,
  bs.title strategy_title,
  bs.business_number,
  bs.description strat_desc,
  bs.status_id,
  bs.target_id,
  bs.owner_unit_id,
  bs.start_date,
  bs.end_date,
  bs.create_by_id,
  bs.create_date,
  bs.update_by_id,
  bs.update_date,
  tr.title target,
  st.title strat_status,
  
  
  rs.status strat_rs,
  rs.overall_comment  strat_rs_comments

FROM 
  BA_STRATEGY bs,
  VALUE_LIST tr,
  VALUE_LIST st

 , (
	  SELECT 
     e.object_id
	-- IDs (just in case) and status descriptions 
   , e.status_id, 					  reporting_status_values.title	  as status
   , e.quality_status_id,			  quality_status_values.title	  as quality_status
   , e.budget_status_id,			  budget_status_values.title	  as budget_status
   , e.time_status_id,				  time_status_values.title 		  as time_status
   -- comments from NOTE table
   , notes.description					  as overall_comment
   , quality_att_notes.description		  as comment_on_quality
   , time_att_notes.description			  as comment_on_time
   , budget_att_notes.description		  as comment_on_budget
     
  FROM 
  -- *******  START nested table 'e' 
  -- *******  all status IDs and corresponding descriptions are flattened to a single row per object_id  
  -- *******  ( in a level above, use it to joinn to NOTE table to retrieve comments ) 
  (
  select 
  d.object_id
  , SUM(status_id) as status_id
  , SUM(time_status_id) as time_status_id
  , SUM(quality_status_id) as quality_status_id
  , SUM(budget_status_id) as budget_status_id
  
  , SUM(report_id ) as report_id 
  , SUM(time_status_report_id) as time_status_report_id
  , SUM(quality_status_report_id ) as quality_status_report_id 
  , SUM(budget_status_report_id ) as budget_status_report_id 
  from
  -- *******  START nested table 'd'
  -- *******  prepare reporting data for grouping by object_id 
  -- *******  it basically ADDs columns to 'c' data, so the reaul set will have OBJECT_ID plus two fields for each 4 attributes 
  -- *******  note that attributes themself are being omittedm but from the column names is obvious what are the refereing to 
  ( 
  	select 
    c.object_id
    , DECODE(c.attribute, null, status_id)       as status_id
    , DECODE(c.attribute, 'Time', status_id) 	 as time_status_id
    , DECODE(c.attribute, 'Quality', status_id)  as quality_status_id
    , DECODE(c.attribute, 'Budget', status_id)   as budget_status_id
   
    , DECODE(c.attribute, null, id) 	  as report_id 	   
    , DECODE(c.attribute, 'Time', id)  	  as time_status_report_id 
    , DECODE(c.attribute, 'Quality', id)  as quality_status_report_id 
    , DECODE(c.attribute, 'Budget', id)   as budget_status_report_id 
    from
	
    -- *******  START nested table 'c''
	-- *******  list RELEVANT / LATEST reporting status IDs for eaach attribute	
	-- *******  flag ACTIVE saves the day here, as there is always ONLY ONE record with ACTIVE == 1 for each of the 
	-- *******  attributes { null, Time, Quality,  Budget } 
    (
      select  a.OBJECT_ID,  a.ATTRIBUTE, a.STATUS_ID, a.id 
      from 
	    report_status a
		, easy_domain -- join to filter out ALL but Files
	  where a.sub_domain_id = easy_domain.ID	   
	  and easy_domain.ID = 3  -- values: 1-SUBMISSION, 3-STRATEGY, 4-FILE, 6- BILL  2 - measurement 
	  and ( a.ATTRIBUTE in ('Time', 'Quality', 'Budget') or a.ATTRIBUTE is null ) 
	  and a.ACTIVE = 1
    ) c	 
    -- *******  END nested table 'c'
	-- ****************************** 
	
   ) d
  -- *******  END nested table 'd' 	
  -- ******************************     
   group by d.object_id 
   
  ) e
  -- *******  END nested table 'e'
  -- ******************************  
  
  
  -- used for (vanila) status' description   
  ,  (select id, title from value_list where type = 'REPORTING_STATUS' ) reporting_status_values

  -- used for ('Time') status' description  
  ,  (select id, title from value_list where type = 'REPORTING_STATUS' ) time_status_values

  -- used for ('Quality') status' description 
  ,  (select id, title from value_list where type = 'REPORTING_STATUS' ) quality_status_values

  -- used for ('Budget') status' description 
  ,  (select id, title from value_list where type = 'REPORTING_STATUS' ) budget_status_values
  

  -- value_id = 13 is 'Reporting Status' sub domain  ID  
  -- Aug 13, 2008 ok, it seems that value_id has silently disapeared so we'll use expression ' easy_domain.Title  = 'Reporting_Status''instead
  , ( select note.object_class_id, note.description from note, easy_domain where easy_domain.Title  = 'Reporting_Status' and sub_domain_id = easy_domain.id)  notes
  , ( select note.object_class_id, note.description from note, easy_domain where easy_domain.Title  = 'Reporting_Status' and sub_domain_id = easy_domain.id ) quality_att_notes
  , ( select note.object_class_id, note.description from note, easy_domain where easy_domain.Title  = 'Reporting_Status' and sub_domain_id = easy_domain.id ) time_att_notes
  , ( select note.object_class_id, note.description from note, easy_domain where easy_domain.Title  = 'Reporting_Status' and sub_domain_id = easy_domain.id ) budget_att_notes
  
  WHERE 	
  	-- join softly VALUE_LIST table(s) ONCE for EACH attribute 
  	reporting_status_values.id(+)	= e.status_id
	and time_status_values.id(+)  	= e.time_status_id
	and quality_status_values.id(+) = e.quality_status_id
	and budget_status_values.id(+)	= e.budget_status_id
	
	-- join softly NOTE table(s) ONCE for EACH attribute 
	and notes.object_class_id(+)	   			= e.report_id
	and quality_att_notes.object_class_id(+)	= e.quality_status_report_id
	and time_att_notes.object_class_id(+)		= e.time_status_report_id
	and budget_att_notes.object_class_id(+)		= e.budget_status_report_id	
	) rs 
WHERE 
  bs.target_id = tr.id AND
  tr.TYPE= 'MINISTRY_TARGET'  AND
  bs.status_id = st.id AND
  st.TYPE = 'EASY_STATUS' 
  and bs.id = :cp_strategy_id  AND
 -- OUTER join
  bs.id = rs.object_id(+) 
  AND   bs.id IN
	  (
		SELECT rvd.object_id
		FROM   REPORT_VALID_SET rvs
			 , REPORT_VALID_DATA rvd
		WHERE rvs.id = rvd.report_valid_set_id 
		AND	  rvd.sub_domain_id = 3
		AND	  rvd.report_valid_set_id  = :P_Report_Valid_Set_ID
		AND	  rvs.session_id = :P_Session_ID)]]></Property>
			</Group>
			<Group Name="Table:">
				<Property Name="Table:"><![CDATA[Q_OBJECTIVES]]></Property>
				<Property Name="SQL Command:"><![CDATA[SELECT 
--'Objectives:' obj_hdr1,
BA_STRATEGY_OBJECTIVE.TITLE st_objective, BA_STRATEGY_OBJECTIVE.STRATEGY_ID
FROM BA_STRATEGY_OBJECTIVE ]]></Property>
			</Group>
			<Group Name="Table:">
				<Property Name="Table:"><![CDATA[Q_UNITS_IT_BELONGS_TO]]></Property>
				<Property Name="SQL Command:"><![CDATA[select bsu.unit_id, 
  u.acronym
, reports_pkg.GETENTIREUNITPATH( U.ID,  reports_pkg.getUnitLastName(u.id)) AS unit_name
, bsu.strategy_id u_strat
from ba_strategy_unit bsu
, unit u
where bsu.unit_id = u.id


/*
select bsu.unit_id, 
u.acronym
, reports_pkg.getUnitLastName(bsu.unit_id) unit_name
, bsu.strategy_id u_strat
from ba_strategy_unit bsu, unit u
where bsu.unit_id = u.id
*/
]]></Property>
			</Group>
			<Group Name="Table:">
				<Property Name="Table:"><![CDATA[Q_METRICS]]></Property>
				<Property Name="SQL Command:"><![CDATA[select  mber.object_id meas_strategy
, mm.title meas_title
, m_utyp.title meas_type
, mm.measure_unit
, m_freq.title meas_freq
, m_stat.title meas_status
, decode(m_type.value_id, 2, 'Rollup Measures', 3, 'Rollup Measures', 'Measures') measure_type
, mm.id  as measurement_id
, mm.business_id  measure_number
from 
m_business_e_ref mber
, m_measure mm
, value_list m_utyp
, value_list m_freq
, value_list m_stat
, value_list m_type



where mber.id = mm.ber_id
and	  mm.measure_unit_type_id = m_utyp.id
and	  m_utyp.type = 'MEASURE_UNIT_TYPE'
and	  mm.recording_frequency_id = m_freq.id
and	  m_freq.type = 'MEASURE_RECORDING_FREQUENCY'
and	  mm.status_id = m_stat.id
and	  m_stat.type = 'EASY_STATUS'
and            mm.type_id = m_type.id
and            m_type.type = 'MEASURE_TYPE'
and            mm.id in
	  (
		SELECT rvd.object_id
		FROM   REPORT_VALID_SET rvs
			 , REPORT_VALID_DATA rvd
		WHERE rvs.id = rvd.report_valid_set_id 
		AND	  rvd.sub_domain_id = 2
		AND	  rvd.report_valid_set_id  = :P_Report_Valid_Set_ID
		AND	  rvs.session_id = :P_Session_ID)]]></Property>
			</Group>
			<Group Name="Table:">
				<Property Name="Table:"><![CDATA[Q_RELATED_FILES]]></Property>
				<Property Name="SQL Command:"><![CDATA[-- Aug 15, 2008 rewrote related files. to simpler, one hopefully

SELECT f.title                                    as  file_name
  , f.business_number                         as  file_number
  , rec_stat.title                                   as  file_status
  
  , reporting_status.status                   as  file_reporting_status
  , reporting_status.overall_comment as  file_reporting_status_comment

  , units.file_division
  , f.id file_id
  
  FROM file_strategy_objective fso
  , ba_file f
  , (select id, title from value_list where type = 'EASY_STATUS') rec_stat 
  
  

-- ************ n e s t e d    r e p o r t i n g    s t a t u s  - S T A R T      ********************
, (
  SELECT 
     e.object_id
	-- IDs (just in case) and status descriptions 
   , e.status_id, 					  reporting_status_values.title	  as status
   , e.quality_status_id,			  quality_status_values.title	  as quality_status
   , e.budget_status_id,			  budget_status_values.title	  as budget_status
   , e.time_status_id,				  time_status_values.title 		  as time_status
   -- comments from NOTE table
   , notes.description					  as overall_comment
   , quality_att_notes.description		  as comment_on_quality
   , time_att_notes.description			  as comment_on_time
   , budget_att_notes.description		  as comment_on_budget
     
  FROM 
  -- *******  START nested table 'e' 
  -- *******  all status IDs and corresponding descriptions are flattened to a single row per object_id  
  -- *******  ( in a level above, use it to joinn to NOTE table to retrieve comments ) 
  (
  select 
  d.object_id
  , SUM(status_id) as status_id
  , SUM(time_status_id) as time_status_id
  , SUM(quality_status_id) as quality_status_id
  , SUM(budget_status_id) as budget_status_id
  
  , SUM(report_id ) as report_id 
  , SUM(time_status_report_id) as time_status_report_id
  , SUM(quality_status_report_id ) as quality_status_report_id 
  , SUM(budget_status_report_id ) as budget_status_report_id 
  from
  -- *******  START nested table 'd'
  -- *******  prepare reporting data for grouping by object_id 
  -- *******  it basically ADDs columns to 'c' data, so the reaul set will have OBJECT_ID plus two fields for each 4 attributes 
  -- *******  note that attributes themself are being omittedm but from the column names is obvious what are the refereing to 
  ( 
  	select 
    c.object_id
    , DECODE(c.attribute, null, status_id)       as status_id
    , DECODE(c.attribute, 'Time', status_id) 	 as time_status_id
    , DECODE(c.attribute, 'Quality', status_id)  as quality_status_id
    , DECODE(c.attribute, 'Budget', status_id)   as budget_status_id
   
    , DECODE(c.attribute, null, id) 	  as report_id 	   
    , DECODE(c.attribute, 'Time', id)  	  as time_status_report_id 
    , DECODE(c.attribute, 'Quality', id)  as quality_status_report_id 
    , DECODE(c.attribute, 'Budget', id)   as budget_status_report_id 
    from
	
    -- *******  START nested table 'c''
	-- *******  list RELEVANT / LATEST reporting status IDs for eaach attribute	
	-- *******  flag ACTIVE saves the day here, as there is always ONLY ONE record with ACTIVE == 1 for each of the 
	-- *******  attributes { null, Time, Quality,  Budget } 
    (
      select  a.OBJECT_ID,  a.ATTRIBUTE, a.STATUS_ID, a.id 
      from 
	    report_status a
		, easy_domain -- join to filter out ALL but Files
	  where a.sub_domain_id = easy_domain.ID	   
	  and easy_domain.ID = 4 -- values: 1-SUBMISSION, 3-STRATEGY, 4-FILE, 6- BILL  2 - measurement 
	  and ( a.ATTRIBUTE in ('Time', 'Quality', 'Budget') or a.ATTRIBUTE is null ) 
	  and a.ACTIVE = 1
    ) c	 
    -- *******  END nested table 'c'
	-- ****************************** 
	
   ) d
  -- *******  END nested table 'd' 	
  -- ******************************     
   group by d.object_id 
   
  ) e
  -- *******  END nested table 'e'
  -- ******************************  
  
  
  -- used for (vanila) status' description   
  ,  (select id, title from value_list where type = 'REPORTING_STATUS' ) reporting_status_values

  -- used for ('Time') status' description  
  ,  (select id, title from value_list where type = 'REPORTING_STATUS' ) time_status_values

  -- used for ('Quality') status' description 
  ,  (select id, title from value_list where type = 'REPORTING_STATUS' ) quality_status_values

  -- used for ('Budget') status' description 
  ,  (select id, title from value_list where type = 'REPORTING_STATUS' ) budget_status_values
  

  -- value_id = 13 is 'Reporting Status' sub domain  ID  
  -- Aug 13, 2008 ok, it seems that value_id has silently disapeared so we'll use expression ' easy_domain.Title  = 'Reporting_Status'' instead
  , ( select note.object_class_id, note.description from note, easy_domain where easy_domain.Title  = 'Reporting_Status' and sub_domain_id = easy_domain.id)  notes
  , ( select note.object_class_id, note.description from note, easy_domain where easy_domain.Title  = 'Reporting_Status' and sub_domain_id = easy_domain.id ) quality_att_notes
  , ( select note.object_class_id, note.description from note, easy_domain where easy_domain.Title  = 'Reporting_Status' and sub_domain_id = easy_domain.id ) time_att_notes
  , ( select note.object_class_id, note.description from note, easy_domain where easy_domain.Title  = 'Reporting_Status' and sub_domain_id = easy_domain.id ) budget_att_notes
  
  WHERE 	
  	-- join softly VALUE_LIST table(s) ONCE for EACH attribute 
  	reporting_status_values.id(+)	= e.status_id
	and time_status_values.id(+)  	= e.time_status_id
	and quality_status_values.id(+) = e.quality_status_id
	and budget_status_values.id(+)	= e.budget_status_id
	
	-- join softly NOTE table(s) ONCE for EACH attribute 
	and notes.object_class_id(+)	   			= e.report_id
	and quality_att_notes.object_class_id(+)	= e.quality_status_report_id
	and time_att_notes.object_class_id(+)		= e.time_status_report_id
	and budget_att_notes.object_class_id(+)		= e.budget_status_report_id
) reporting_status	


-- ************ n e s t e d    r e p o r t i n g    s t a t u s  - S T A R T      ********************

  
  -- add units related to associated files 
  ,(
  	select fu.FILE_ID, reports_pkg.getEntireUnitPath( fu.unit_id,  reports_pkg.GETUNITLASTNAME(u.id )) as file_division
  	from file_unit fu, unit u
	where u.ID = fu.UNIT_ID
  )  units
   
  
   
    
  WHERE  strategy_id = :P_OBJECT_ID
   and f.id 		 = fso.file_id
   and rec_stat.id	 = f.status_id

   -- join 'divisions'
   and units.file_id = f.id

   -- join reporting status data
   and reporting_status.object_id(+) = f.id
  AND   f.id IN
	  (
		SELECT rvd.object_id
		FROM   REPORT_VALID_SET rvs
			 , REPORT_VALID_DATA rvd
		WHERE rvs.id = rvd.report_valid_set_id 
		AND	  rvd.sub_domain_id = 4
		AND	  rvd.report_valid_set_id  = :P_Report_Valid_Set_ID
		AND	  rvs.session_id = :P_Session_ID)]]></Property>
			</Group>
			<Group Name="Table:">
				<Property Name="Table:"><![CDATA[Q_DOCUMENTS]]></Property>
				<Property Name="SQL Command:"><![CDATA[-- Sep 3, added the "latest version" nested table

SELECT 

     cm.co_menutext doc_pkg_templ_name
      , dt.title doc_type_title
     , doc.co_description doc_desc
     ,  doc.co_docname
     , :id  doc_sub_id
     , co_sourceauthor doc_creator
     , vrsn.co_filename
     , to_date(co_docdate, 'MM/DD/YY HH:MI AM') doc_date
    , vrsn.co_version
    , doc.co_docid as doc_id
   , 'Documents:' as dummy_field

FROM (
      select b.co_menutext, b.co_menuid, level
	  from co_menus b		
	  connect by prior b.CO_MENUID = b.CO_MENUPARENT 
	  start with b.CO_MENUID in (
	  select a.co_menuid from co_menus a where a.CO_MENUPARENT = 0 and TRIM(a.co_menuref) = '3_' ||  TO_CHAR(:id)
	   )
      ) cm
	 , co_document doc
	 , document_type dt
	 , (
	   select ver.co_version, ver.co_versioncomment , ver.co_docid, ver.co_filename
		from co_versions ver
		where ver.co_version = ( select max(ver2.co_version) from co_versions ver2 where ver2.co_docid = ver.co_docid)	  
	   ) vrsn

WHERE doc.co_menuid = cm.co_menuid
and doc.co_doctype = dt.id(+)
and	vrsn.co_docid = doc.co_docid]]></Property>
			</Group>
			<Group Name="Table:">
				<Property Name="Table:"><![CDATA[Q_CONTACTS]]></Property>
				<Property Name="SQL Command:"><![CDATA[-- query for Summary Reports 
-- provides data to list contacts as tha application does, i.e. ministry, contact team, roles , users
-- first sort criteria is contact potfolio's ministry, and current ministry is listed first ( 'sort_id  )  

select 
	 DECODE(u.ministry_id, :P_MIN_ID, -999, ABS(u.ministry_id)) as sort_id
	 , reports_pkg.GETUNITLASTNAME( u.ministry_id ) as Contact_Portf_Ministry
   	 , cp.object_id as cont_object_id
     --, u.acronym as cont_unit
     , ct.title  as  cont_team_title
     , cr.title  as  cont_role_title
     , i.first_name || ' ' || i.last_name cont_name
	   
from  easy_contact_portfolio cp 
	 , CONTACT_GROUP cg, CONTACT c
	 , contact_role cr, contact_team ct
   	 , individual i
  	 , unit u
	 , easy_domain d
where cp.id = cg.EASY_CONTACT_PORTFOLIO_ID
	  
	     
	  and cg.id = c.CONTACT_GROUP_ID
	  and c.contact_role_id = cr.id
	  and ct.id = cg.contact_team_id
	  and ct.id = cr.contact_team_id
	  and c.status = 1
	  -- join individual     
	  and c.individual_id = i.id
	  -- join unit table  
	  and cp.unit_id = u.id
	  -- jOion domain table 
	  and d.id = cp.SUB_DOMAIN_ID
	  --  filter all but our domain records
	  and d.id = 3   --      :P_SUB_DOMAIN_ID  --  1 - SUBMISSION, 3 - STRATEGY, 4 - FILE,  - BILL	  
      
                  --and cp.object_id = :P_OBJECT_ID
	  
--order by 1,  ct.title, cr.title, cont_name

]]></Property>
			</Group>
			<Group Name="Table:">
				<Property Name="Table:"><![CDATA[Q_GRAPH_DATA_TABULAR_VIEW]]></Property>
				<Property Name="SQL Command:"><![CDATA[/* 
    JK Jan 8 2009 add 'm_graphing' table to second query in UNION ALL clause. 
    It's NOT to get any data for a result set but to use it as a filter to make sure that only data from a single target set is displayed 
    It used to be 'm_target_portfolio.is_master' column used for that, and now is m_graphing.target_portfolio_id' 
    The moment when 'm_graphing' table has more then one record - we are screwed 


SELECT a.record_date   as gr_record_date
, sum(a.target_value ) as gr_target_value
, sum(a.period_value)  as gr_actual_value
, sum(a.total_value)   as gr_total_to_date
,   :measurement_id as raw_data_measure_id
FROM 
(
 	 -- first union provides only actual values, and always zero as 'Target Value' 
	 select a.record_date 
	 , 0 as target_value 
	 , a.period_value
	 , a.total_value
	 from m_actual_record a
	 where a.measure_id = :MEASUREMENT_ID

	 	   union all

	-- second union provides only 'Target Value'' and zeros instead of actual values 
	select 
	 t.RECORD_DATE 
--	 , t.PERIOD_VALUE
	 , t.VALUE
	 , 0
	 , 0 

	 from  
	  m_target_record t
	  , m_target_portfolio tp
                  , m_graphing  g
	  where tp.MEASURE_ID = :MEASUREMENT_ID
	  and t.TARGET_PORTFOLIO_ID = tp.ID
	  --and tp.IS_MASTER = 1
                  and g.target_portfolio_id = tp.id and g.measure_id = tp.measure_id
) a

GROUP BY a.RECORD_DATE
*/


SELECT a.record_date   as gr_record_date

 -- Jan 29 2009 - using "min()" here because "sum()" would not take non-digits. Should be the same result, as there is 
,  MIN(   to_char( a.target_value )   ||   DECODE( a.high_value, 0, '',    ' - ' ||   to_char(a.high_value) )    )      as gr_target_value 
, sum(a.period_value)  as gr_actual_value
, sum(a.total_value)   as gr_total_to_date
,   :measurement_id as raw_data_measure_id
FROM 
(
 	 -- first union provides only actual values, and always null as 'Target Value' 
	 select a.record_date 
	 , Null as target_value 
	 , a.period_value
	 , a.total_value
                 , a.measure_id 
                 , 0 high_value                  
	 from m_actual_record a
	 where a.measure_id = :measurement_id

	 	   union all

	-- second union provides only 'Target Value'' and nulls instead of actual values 
	select 
	 t.RECORD_DATE 
                 -- JK Sep 24, 2008 do note that in m_target_record, the values are in VALUE column, unlike in m_actual_record where it's in PERIOD_VALUE
	, t.value as PERIOD_VALUE
	 , Null
	 , Null 
                 , tp.MEASURE_ID
                 , t.high_value
	 from  
	  m_target_record t
	  , m_target_portfolio tp
                  , m_graphing g
	  where tp.MEASURE_ID = :measurement_id
	  and t.TARGET_PORTFOLIO_ID = tp.ID
	  -- JK 16-DEC-2008  obsolete check: and tp.IS_MASTER = 1                
                  and g.target_portfolio_id = tp.id and g.measure_id = tp.measure_id
) a

GROUP BY a.RECORD_DATE]]></Property>
			</Group>
			<Group Name="Table:">
				<Property Name="Table:"><![CDATA[Q_Graph_Of_Master_Target]]></Property>
				<Property Name="SQL Command:"><![CDATA[---------------------------------------------------------------------------------------------------------------------------
-------------------     NOTE: this will retun a SINGLE graphing id, but only because target portfolio
-------------------     selected is MASTER target portfolio
-------------------     otherwise, it one-to_many relationsio between measure and graphs
--------------------------------------------------------------------------------------------------------------------------
 SELECT 
  		 a.MEASURE_ID graph_measure_id
		 , a.id as graphing_id
		 , vl.title as system_or_user_generated
                                 , TP.STATEMENT_OF_RESULT
		   
		   -- add image for measure. 
		   -- there can be many graphs for a single measurement, but as we will 
		   -- consider only MASTER portfolio, effectively there will be one image per measurement 
		   
		   ,image_source.co_docid
		   ,image_source.co_versioncomment
		   ,image_source.co_filecontent		   

                                   -- similar rational as for images - read m_graphing data of master target portfolio only. in order to figure out graph type
                                   , graph_type_nt.Line_or_Bar
		   

  
  FROM 
  	   m_graphing a
	   , value_list vl
	   , m_target_portfolio tp
	  
	   -- TODO explain nested 'image_siurce' table
	   , (select 	doc_versions.co_docid, doc_versions.co_versioncomment, doc_versions.co_filecontent, :measurement_id as measure_id			   
	   	   from (select b.co_menutext, b.co_menuid, level, sys_connect_by_path( co_menutext, '\' ) path
		   	  from co_menus b		
			  connect by prior b.co_menuid = b.co_menuparent 
			  start with b.co_menuid in (
			   	     select a.co_menuid from co_menus a where a.co_menuparent = 0 and a.co_menuref =  
		 	  		 -- s t a r t  give me graphing id that corresponds to master portfolio, for known measure id 
			  	  	 (select '22_' || to_char(nvl(max(g2.id),0))
				   	 from m_graphing g2, m_target_portfolio tp2 
				     where g2.measure_id =  :measurement_id
				     and tp2.measure_id = g2.measure_id
				     and tp2.id = g2.target_portfolio_id
				     -- JK 22-Jan-2009 OBSOLETE and tp2.is_master = 1
				   	 )	  
			  		 -- e n d  give me graphing id that corresponds to master portfolio, for known measure id 		 
					 	  	 ) 
	 	  ) cm
	 	  , co_document doc
		  , document_type dt
		  , (
	 	  	select ver.co_docid, ver.co_versioncomment, ver.co_filecontent 
			from co_versions ver
			where ver.co_version = ( select max(ver2.co_version) from co_versions ver2 where ver2.co_docid = ver.co_docid) 
                                                -- skip all but .bmp, .jpg and .gif files (JK 11-Mar-2009)
                                                and upper(substr(ver.co_filename, instr(ver.co_filename, '.', -1, 1) + 1)) in ('JPG', 'BMP', 'GIF')	 	 
		 ) doc_versions	 
		 where doc.co_menuid = cm.co_menuid
		   and doc.co_doctype = dt.id(+)
		   -- join ('vrsions' ) table that contains the image  	  
		   and doc.co_docid = doc_versions.co_docid
		) image_source   


                      -- create table that'll give graph type for master target set Line or Bar, based on 'm_graphing.format_id' value
                      -- 'decode' is to translate to Report Builder dictionary
                     ,  (  select vl2.id
                             , DECODE(vl2.title, 'Line', 'LINE_VERT_ABS', 'Bar', 'BAR_VERT_CLUST', 'LINE_VERT_ABS' ) as Line_or_Bar
                             from value_list vl2
                                where vl2.type = 'MEASURE_GRAPH_PRESENTATION'
                        )  graph_type_nt
                       
	     
	   

  where a.MEASURE_ID = :measurement_id
  and vl.type = 'MEASURE_GRAPH_TYPE' 
  and vl.id = a.TYPE_ID
  and a.TARGET_PORTFOLIO_ID  = tp.id
  -- JK 22-Jan-2009 OBSOLETE and tp.IS_MASTER = 1
  -- image part might not have anything 
  and a.MEASURE_ID = image_source.measure_id(+)   
  -- join nested table to give us graph type
  and graph_type_nt.id = a.format_id
]]></Property>
			</Group>
			<Group Name="Table:">
				<Property Name="Table:"><![CDATA[Q_Legends]]></Property>
				<Property Name="SQL Command:"><![CDATA[/* 
              ----------------------------------------------------------
               ------------ build legends query --------------
               ---------------------------------------------------------- 
		
	SELECT a.title as measurements_set_name, rownum, a.id as graphing_id, measure_id  as legend_measure_id 

	FROM (					   	  			 									  
	  select distinct 'Targets (' || tp3.TITLE || ')' as title
                 , g3.id 
                 , tp3.MEASURE_ID
	  from m_target_portfolio tp3 ,  M_GRAPHING_VALUE gv3, m_graphing g3
	  where  tp3.MEASURE_ID = :measurement_id
	  and g3.TARGET_PORTFOLIO_ID = tp3.id
	  and gv3.GRAPHING_ID = g3.id	
                  -- JK 21-JAN-2009 obsolete check: and tp3.is_master = 1				  	
			  UNION ALL				
	
	  -- select distinct 'Actuals', 0, measure_id  from m_actual_record where measure_id = :measure_id
                  -- Jaroslav Kolar, Sep 25, 2008 retieving from actualls is wating CPU cycles and more importantly, it does not return anything in case when actuals are NOT existing 
                  -- as a consequence, legend will not have a red box denoting actual values ...
                  -- and at the same time, 'm_graphing_value' table willl contain (zero) values so the flat line at the bottom will be drawn
                  -- That might be confusing ( line without legend explaining it ) and therefore this retrieval from 'dual' that will ensure that acutals record is always there
                  select 'Actuals', 0, :measurement_id as measure_id  from dual
	  ) a
	  
                -- JK Oct 23, can I assume :CP_SERIES_COUNT is 1 all the time ???? 
                -- WHERE rownum <=  :CP_SERIES_COUNT + 1  -- adding one is because actuals are handled differently
                 WHERE rownum <=  2

                -- this is taking the value from parent query and basically killing the result set if graph is marked as 'User Provided'
                and :system_or_user_generated = 'System Generated'

	ORDER BY 3
*/

               ----------------------------------------------------------
               ------------ build legends query --------------
               ----------------------------------------------------------

               -- as of Rel 3.0,  there will be only one record (per measurement) in 'm_graphing' table
		
	SELECT a.title as measurements_set_name, rownum, a.id as graphing_id, measure_id  as legend_measure_id 

	FROM (					   	  			 									  

	  select distinct 'Targets (' || tp3.TITLE || ')' as title
                 , g3.id 
                 , tp3.MEASURE_ID
	  from m_target_portfolio tp3, m_graphing g3
	  where  tp3.MEASURE_ID = :measurement_id
	  and g3.TARGET_PORTFOLIO_ID = tp3.id
                   -- JK 16-DEC-2008 obsolete check: and tp3.is_master = 1				  	

			  UNION ALL				
	
	  -- retrieval from 'dual' that will ensure that acutals record is always there
                  select 'Actuals', 0, :measurement_id as measure_id  from dual


			UNION ALL

	 -- third part of the union, will return a result set only id targets are declaed as ranges  			  
	  select distinct 'Targets High Values' as title
  	 , g3.id 
                 , tp3.MEASURE_ID
	  from m_target_portfolio tp3 , m_graphing g3, value_list vl
	  where  tp3.MEASURE_ID = :measurement_id
	  and g3.TARGET_PORTFOLIO_ID = tp3.id
	  and vl.type = 'MEASURE_TARGET_DEFINITION'
	  and tp3.definition_id = vl.id
	  and vl.title = 'Range'

	  ) a 
	  
                -- JK Oct 23, can I assume :CP_SERIES_COUNT is 1 all the time ???? 
                -- WHERE rownum <=  :CP_SERIES_COUNT + 1  -- adding one is because actuals are handled differently
                 WHERE rownum <=  3

                -- this is taking the value from parent query and basically killing the result set if graph is marked as 'User Provided'
                and :system_or_user_generated = 'System Generated'

	ORDER BY 3]]></Property>
			</Group>
			<Group Name="Table:">
				<Property Name="Table:"><![CDATA[Q_Graphing_Values]]></Property>
				<Property Name="SQL Command:"><![CDATA[--  Jaroslav, Aug 12 2008  added M_TARGET_PORTFOLIO to the query,
--  which probably makes  M_GRAPHING_VALUE and nested 'a' table obsolete
--  that was meant for VARIABLE number of target sets.
--   Anyway, I will leave it for now.

-- NOTE: watch out when introducing column aliases as &CP_.....
-- that column might not show up AT ALL so query-rebuild might be the only solution

-- JK: 25-Jan-2009 - recode


 	SELECT     
	   gv.graphing_id
	  , gv.label as x_axis_value
	  , gv.measure_value as ACTUAL_VALUE1
	  , gv.target_value as TARGET_VALUE1
	  , gv.TARGET_HIGH_VALUE
       , g.measure_id as graphing_measure_id
                 
	FROM m_graphing g
	   , m_graphing_value gv
	   
	WHERE gv.GRAPHING_ID = g.id

	  and g.measure_id = :measurement_id -- value from the parent table  

      -- this is taking the value from parent query and basically killing the result set if graph is marked as 'User Provided'
      and :system_or_user_generated = 'System Generated'
	   
	ORDER BY gv.graphing_id



/*
 SELECT     
	   gv.GRAPHING_ID
	  , gv.label as x_axis_value
	  , gv.MEASURE_VALUE as actual_value
	  , gv.TARGET_VALUE
	  , b.row_number
	 -- , b.graphing_id 
	  , DECODE( b.row_number, 1, gv.MEASURE_VALUE) as  ACTUAL_VALUE1
	  , DECODE( b.row_number, 1, gv.TARGET_VALUE)  as  TARGET_VALUE1
	  , DECODE( b.row_number, 2, gv.TARGET_VALUE) as TARGET_VALUE2
	  , DECODE( b.row_number, 3, gv.TARGET_VALUE) as TARGET_VALUE3
	  , DECODE( b.row_number, 4, gv.TARGET_VALUE) as TARGET_VALUE4
	  , DECODE( b.row_number, 5, gv.TARGET_VALUE) as TARGET_VALUE5
	  , DECODE( b.row_number, 6, gv.TARGET_VALUE) as TARGET_VALUE6
	  , DECODE( b.row_number, 7, gv.TARGET_VALUE) as TARGET_VALUE7
	  , DECODE( b.row_number, 8, gv.TARGET_VALUE) as TARGET_VALUE8
	  , DECODE( b.row_number, 9, gv.TARGET_VALUE) as TARGET_VALUE9
                  -- add measure id to be linked to 'measurement' table
                  , g.measure_id as graphing_measure_id
                 
	FROM m_graphing g
	   , M_GRAPHING_VALUE gv   
	   , ( 
	    	 SELECT rownum as row_number, a.graphing_id
			 	 FROM ( 
				 	 	 select distinct graphing_id 
				 	 	 from M_GRAPHING_VALUE gv2
				 		 	 ,  m_graphing g2 
			 			 	 where gv2.GRAPHING_ID = g2.id
		 				 	  and g2.measure_id in :measurement_id -- value from the parent table
                                           
					  ) a	 
	 
	  	  ) b	   
	   , m_target_portfolio tp
	   
	 WHERE gv.GRAPHING_ID = g.id

	  and gv.GRAPHING_ID = b.GRAPHING_ID

                  and tp.id = g.target_portfolio_id

                  -- select only DOMINANT one
                  -- JK 16-DEC-2008 obsolete check:  and tp.is_master = 1

                   -- this is taking the value from parent query and basically killing the result set if graph is marked as 'User Provided'
                  and :system_or_user_generated = 'System Generated'


	   
	 ORDER BY gv.GRAPHING_ID
*/
]]></Property>
			</Group>
			<Group Name="Table:">
				<Property Name="Table:"><![CDATA[Q_Chart_Attributes]]></Property>
				<Property Name="SQL Command:"><![CDATA[   SELECT 
    c.id as basic_chart_id,
    c.chart_data_id as chart_data_id
  , c.title as chart_title
  , c.header as chart_header
  , c.footer as chart_footer
  , c.period_start as chart_start_dt
  , c.period_end as chart_end_dt
--  , c.style_id as chart_style  
  , freq.freq_title
 , c.description as chart_description
 , c.data_source as chart_data_source
 , rs.status as chart_reporting_status
 , rs.overall_comment as chart_rep_status_comment 

, parent.chart_parent_id
, parent.sub_domain_id
  
  FROM 
  m_chart c
  , ( select id as freq_id, title as freq_title from value_list where type = 'MEASURE_RECORDING_FREQUENCY' ) freq
  
  -- nested table  that gived ber_id for given parent S T A R T 
  , (
 	select ber.id  as chart_ber_id, str.id  as chart_parent_id, ber.sub_domain_id
  	from m_business_e_ref ber, ba_strategy str
                where ber.sub_domain_id = 3
                and str.id = ber.object_id
		 and str.id = :id
   ) parent
   -- nested table  that gived ber_id for given parent E N D 
  
  
    -- nested table with reporting status and comment S T A R T 
  , ( 
     select    
     a.object_id
     , a.status_id
     , reporting_status_values.title	  as status
     -- comments from NOTE table
     , notes.description				  as overall_comment	  
     from report_status a   
     , (select id, title from value_list where type = 'REPORTING_STATUS' ) reporting_status_values
     , ( select note.object_class_id, note.description from note, easy_domain where easy_domain.Title  = 'Reporting_Status' and sub_domain_id = easy_domain.id)  notes
     where 
  	  a.sub_domain_id = 19
  	  and ( a.attribute is null ) 
	  and a.active = 1   	
  	  -- join softly VALUE_LIST table(s) ONCE for EACH attribute 
  	  and reporting_status_values.id(+)	= a.status_id	
	  -- join softly NOTE table(s) 
	  and notes.object_class_id(+) = a.id
    )   rs
	-- nested table with reporting status and comment E N D 

  WHERE  
   parent.chart_ber_id = c.ber_id    
   and c.recording_frequency_id = freq_id(+)   
   and c.id = rs.object_id(+)]]></Property>
			</Group>
			<Group Name="Table:">
				<Property Name="Table:"><![CDATA[Q_1]]></Property>
				<Property Name="SQL Command:"><![CDATA[SELECT DECODE(SUBSTR( upper(category_scope.title),1,3), 'OPS', '1OPS-Wide Management Categories', 'MIN', '2'||:CP_Ministry_Acronym || '-Specific Management Categories', '3Division-Specific Management Categories') || ':' as category_scope
, mc.TITLE AS category_title
--, LPAD(' ', (LEVEL - 1)*7) || lpad(lvel.TITLE, 20) || ':  ' || value.title AS sub_categories_tree
--, lvel.title cat_hierarchy_title, value.title AS sub_categories_tree
, LPAD(' ', (LEVEL - 1)*7) || lpad(lvel.TITLE, 20) cat_hierarchy_title, value.title AS sub_categories_tree
, DECODE(SUBSTR( UPPER(category_scope.title),1,3), 'OPS', 1, 'MIN', 2, 3 ) AS sort_by_scope
, value.id value_id
FROM  MGMT_CATEGORY_VALUE value 
, MGMT_CATEGORY_LEVEL lvel
, MANAGEMENT_CATEGORY mc 
, (SELECT title, id FROM VALUE_LIST WHERE TYPE = 'MANAGEMENT_CATEGORY_SCOPE') category_scope
WHERE value.MGMT_CATEGORY_LEVEL_ID = lvel.ID
AND mc.ID = lvel.MANAGEMENT_CATEGORY_ID
AND category_scope.id = mc.SCOPE_ID
AND mc.ENABLED = 1
AND value.id IN (

 -- nested_2: expanded a list from 'nested_1' with parent IDs
SELECT DISTINCT id
 FROM  MGMT_CATEGORY_VALUE 
  START WITH id IN (    
   -- nested_1 : list only values linked to to given file ID  
    SELECT value2.id FROM 
	 MGMT_CATEGORY_VALUE value2 
      ,FILE_MANAGEMENT_CATEGORY fmc2
        WHERE value2.id = fmc2.MGMT_CATEGORY_VALUE_ID
        AND	  fmc2.FILE_ID =  :FILE_ID
           
  )
  CONNECT BY PRIOR PARENT_ID = id

) 
  START WITH value.PARENT_ID IS NULL
   CONNECT BY PRIOR value.id = value.PARENT_ID
order by  3 desc
   ]]></Property>
			</Group>
			<Group Name="Table:">
				<Property Name="Table:"><![CDATA[Q_2]]></Property>
				<Property Name="SQL Command:"><![CDATA[--SELECT  lvel.hierarchy_level , lvel.title hierarchy_title, value.title AS hierarchy_tree
--SELECT rpad(lvel.TITLE, 20) || ':  ' || value.title AS hierarchy_tree
SELECT  lvel.hierarchy_level , lvel.title hierarchy_title, LPAD(' ', (LEVEL - 1)*7) || lpad(value.TITLE, 20) AS hierarchy_tree
FROM  MGMT_CATEGORY_VALUE value 
, MGMT_CATEGORY_LEVEL lvel
, MANAGEMENT_CATEGORY mc 
, (SELECT title, id FROM VALUE_LIST WHERE TYPE = 'MANAGEMENT_CATEGORY_SCOPE') category_scope
WHERE value.MGMT_CATEGORY_LEVEL_ID = lvel.ID
AND mc.ID = lvel.MANAGEMENT_CATEGORY_ID
AND category_scope.id = mc.SCOPE_ID
AND mc.ENABLED = 1
AND value.id != :id
AND value.id IN (

 -- nested_2: expanded a list from 'nested_1' with parent IDs
SELECT DISTINCT id
 FROM  MGMT_CATEGORY_VALUE 
  START WITH id IN (    
   -- nested_1 : list only values linked to to given file ID  
    SELECT value2.id FROM 
	 MGMT_CATEGORY_VALUE value2 
      ,FILE_MANAGEMENT_CATEGORY fmc2
        WHERE value2.id = fmc2.MGMT_CATEGORY_VALUE_ID
           
  )
  CONNECT BY PRIOR PARENT_ID = id

) 
  START WITH value.id = :id --value.PARENT_ID IS NULL
   CONNECT BY PRIOR value.parent_id = value.id
ORDER BY   lvel.hierarchy_level ]]></Property>
			</Group>
			<Group Name="Table:">
				<Property Name="Table:"><![CDATA[Q_BUILT_CHART]]></Property>
				<Property Name="SQL Command:"><![CDATA[
 SELECT
  :chart_data_id as data_chart_id, 
  r.row_number as chart_row_number, 
  min( decode(ac.column_number, 0, ac.data, null)) col1, 
  min( decode(ac.column_number, 1, ac.data, null)) col2, 
  min( decode(ac.column_number, 2, ac.data, null)) col3, 
  min( decode(ac.column_number, 3, ac.data, null)) col4, 
  min( decode(ac.column_number, 4, ac.data, null)) col5, 
  min( decode(ac.column_number, 5, ac.data, null)) col6, 
  min( decode(ac.column_number, 6, ac.data, null)) col7, 
  min( decode(ac.column_number, 7, ac.data, null)) col8	  
FROM 
  (
    SELECT 
      cell.data as data,
      col.column_number as column_number,
      cell.chart_data_id as chart_data_id,
      cell.chart_row_id as chart_row_id
    FROM
      chart_column col,
      chart_cell cell
    WHERE
      col.chart_data_id = :chart_data_id 
      AND cell.chart_column_id(+) = col.id
  ) ac, 
  chart_row r
WHERE
  r.chart_data_id = :chart_data_id 
	and ac.chart_row_id(+) = r.id
GROUP BY 
  r.row_number	  
ORDER BY 
  1,2;]]></Property>
			</Group>
		</Group>
		<Group Name="Table Links">
			<Property Name="Joins:"><![CDATA[where [G_TITLE].[ID] = [Q_OBJECTIVES].[STRATEGY_ID]
where [G_TITLE].[ID] = [Q_UNITS_IT_BELONGS_TO].[u_strat]
where [G_TITLE] = [Q_DOCUMENTS]
where [G_TITLE].[ID] = [Q_CONTACTS].[cont_object_id]
where [G_TITLE].[ID] = [Q_METRICS].[meas_strategy]
where [G_MEASURE_DATA].[measurement_id] = [Q_Graph_Of_Master_Target].[graph_measure_id]
where [G_MEASURE_DATA].[measurement_id] = [Q_Legends].[legend_measure_id]
where [G_MEASURE_DATA].[measurement_id] = [Q_GRAPH_DATA_TABULAR_VIEW].[raw_data_measure_id]
where [G_graph_measure_id].[graphing_id1] = [Q_Graphing_Values].[GRAPHING_ID2]
where [G_category_scope] = [Q_2]
where [G_RELATED_FILE_DETAILS] = [Q_1]
where [G_TITLE].[ID] = [Q_Chart_Attributes].[chart_parent_id]
where [G_Attribute].[chart_data_id] = [Q_BUILT_CHART].[data_chart_id]]]></Property>
		</Group>
		<Group Name="Placeholder Columns">
			<Group Name="Column:">
				<Property Name="Column:"><![CDATA[CP_Strategy_ID]]></Property>
				<Property Name="Data Type:"><![CDATA[number]]></Property>
				<Property Name="Label:"><![CDATA[Cp Strategy Id]]></Property>
			</Group>
			<Group Name="Column:">
				<Property Name="Column:"><![CDATA[CP_Version]]></Property>
				<Property Name="Data Type:"><![CDATA[character]]></Property>
			</Group>
			<Group Name="Column:">
				<Property Name="Column:"><![CDATA[CP_Ministry_Acronym]]></Property>
				<Property Name="Data Type:"><![CDATA[character]]></Property>
			</Group>
		</Group>
		<Group Name="Summary Columns">
			<Group Name="Column:">
				<Property Name="Column:"><![CDATA[CS_Objectives_Cnt]]></Property>
				<Property Name="Label:"><![CDATA[Cs Objectives Cnt]]></Property>
				<Property Name="Source:"><![CDATA[st_objective]]></Property>
				<Property Name="Function:"><![CDATA[count]]></Property>
			</Group>
			<Group Name="Column:">
				<Property Name="Column:"><![CDATA[CS_CNT_RELATED_FILES]]></Property>
				<Property Name="Source:"><![CDATA[file_number]]></Property>
				<Property Name="Function:"><![CDATA[count]]></Property>
			</Group>
			<Group Name="Column:">
				<Property Name="Column:"><![CDATA[CS_CNT_DOCUMENTS]]></Property>
				<Property Name="Source:"><![CDATA[co_docname]]></Property>
				<Property Name="Function:"><![CDATA[count]]></Property>
			</Group>
			<Group Name="Column:">
				<Property Name="Column:"><![CDATA[CS_CNT_CONTACTS]]></Property>
				<Property Name="Source:"><![CDATA[cont_role_title]]></Property>
				<Property Name="Function:"><![CDATA[count]]></Property>
			</Group>
		</Group>
		<Group Name="Formula Fields">
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[cf_doc_desc_decryptformula]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Return Type:"><![CDATA[character]]></Property>
				<Property Name="Formula:"><![CDATA[function CF_doc_desc_decryptFormula return Character is
  jObj    ora_java.jobject;
  l_Desc  submission.description%type;
  l_vl_id	number;
begin
  jObj := EVistaEncryptor.getInstance;
  l_Desc := rep_util_pkg.truncate_string(EVistaEncryptor.decrypt(jObj, :doc_desc), 500);
  return (lpad(' ', 12,' ')||l_Desc);
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[evistaencryptor]]></Property>
				<Property Name="Type:"><![CDATA[packageBody]]></Property>
				<Property Name="Formula:"><![CDATA[PACKAGE BODY EVistaEncryptor IS

  -- 
  -- DO NOT EDIT THIS FILE - it is machine generated!
  -- 

  args   JNI.ARGLIST;

  -- Method: main ([Ljava/lang/String;)V
  PROCEDURE main(
    a0    ORA_JAVA.JARRAY) IS
  BEGIN
    args := JNI.CREATE_ARG_LIST(1);
    JNI.ADD_OBJECT_ARG(args, a0, '[Ljava/lang/String;');
    JNI.CALL_VOID_METHOD(TRUE, NULL, 'ca/on/gov/gsdc/evista/common/security/EVistaEncryptor', 'main', '([Ljava/lang/String;)V', args); 
  END;

  -- Method: getInstance ()Lca/on/gov/gsdc/evista/common/security/EVistaEncryptor;
  FUNCTION getInstance RETURN ORA_JAVA.JOBJECT IS
  BEGIN
    args := NULL;
    RETURN JNI.CALL_OBJECT_METHOD(TRUE, NULL, 'ca/on/gov/gsdc/evista/common/security/EVistaEncryptor', 'getInstance', '()Lca/on/gov/gsdc/evista/common/security/EVistaEncryptor;', args); 
  END;

  -- Method: encrypt (Ljava/lang/String;)Ljava/lang/String;
  FUNCTION encrypt(
    obj   ORA_JAVA.JOBJECT,
    a0    VARCHAR2) RETURN VARCHAR2 IS
  BEGIN
    args := JNI.CREATE_ARG_LIST(1);
    JNI.ADD_STRING_ARG(args, a0);
    RETURN JNI.CALL_STRING_METHOD(FALSE, obj, 'ca/on/gov/gsdc/evista/common/security/EVistaEncryptor', 'encrypt', '(Ljava/lang/String;)Ljava/lang/String;', args); 
  END;

  -- Method: decrypt (Ljava/lang/String;)Ljava/lang/String;
  FUNCTION decrypt(
    obj   ORA_JAVA.JOBJECT,
    a0    VARCHAR2) RETURN VARCHAR2 IS
  BEGIN
    args := JNI.CREATE_ARG_LIST(1);
    JNI.ADD_STRING_ARG(args, a0);
    RETURN JNI.CALL_STRING_METHOD(FALSE, obj, 'ca/on/gov/gsdc/evista/common/security/EVistaEncryptor', 'decrypt', '(Ljava/lang/String;)Ljava/lang/String;', args); 
  END;

  -- Method: encryptInt (I)Ljava/lang/String;
  FUNCTION encryptInt(
    obj   ORA_JAVA.JOBJECT,
    a0    NUMBER) RETURN VARCHAR2 IS
  BEGIN
    args := JNI.CREATE_ARG_LIST(1);
    JNI.ADD_INT_ARG(args, a0);
    RETURN JNI.CALL_STRING_METHOD(FALSE, obj, 'ca/on/gov/gsdc/evista/common/security/EVistaEncryptor', 'encryptInt', '(I)Ljava/lang/String;', args); 
  END;

  -- Method: decryptInt (Ljava/lang/String;)I
  FUNCTION decryptInt(
    obj   ORA_JAVA.JOBJECT,
    a0    VARCHAR2) RETURN NUMBER IS
  BEGIN
    args := JNI.CREATE_ARG_LIST(1);
    JNI.ADD_STRING_ARG(args, a0);
    RETURN JNI.CALL_INT_METHOD(FALSE, obj, 'ca/on/gov/gsdc/evista/common/security/EVistaEncryptor', 'decryptInt', '(Ljava/lang/String;)I', args); 
  END;


BEGIN
  NULL;
END;
]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[evistaencryptor]]></Property>
				<Property Name="Type:"><![CDATA[packageSpec]]></Property>
				<Property Name="Formula:"><![CDATA[PACKAGE EVistaEncryptor /* ca.on.gov.gsdc.evista.common.security.EVistaEncryptor */ IS

  -- 
  -- DO NOT EDIT THIS FILE - it is machine generated!
  -- 


  -- Method: main ([Ljava/lang/String;)V
  PROCEDURE main(
    a0    ORA_JAVA.JARRAY);

  -- Method: getInstance ()Lca/on/gov/gsdc/evista/common/security/EVistaEncryptor;
  FUNCTION getInstance RETURN ORA_JAVA.JOBJECT;

  -- Method: encrypt (Ljava/lang/String;)Ljava/lang/String;
  FUNCTION encrypt(
    obj   ORA_JAVA.JOBJECT,
    a0    VARCHAR2) RETURN VARCHAR2;

  -- Method: decrypt (Ljava/lang/String;)Ljava/lang/String;
  FUNCTION decrypt(
    obj   ORA_JAVA.JOBJECT,
    a0    VARCHAR2) RETURN VARCHAR2;

  -- Method: encryptInt (I)Ljava/lang/String;
  FUNCTION encryptInt(
    obj   ORA_JAVA.JOBJECT,
    a0    NUMBER) RETURN VARCHAR2;

  -- Method: decryptInt (Ljava/lang/String;)I
  FUNCTION decryptInt(
    obj   ORA_JAVA.JOBJECT,
    a0    VARCHAR2) RETURN NUMBER;

END;
]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[cf_ministry_nameformula]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Return Type:"><![CDATA[character]]></Property>
				<Property Name="Formula:"><![CDATA[function CF_Ministry_NameFormula return Char is
  l_Ministry varchar2(100);
begin
	if :p_min_id is not null then
		begin
		  select reports_pkg.getUnitLastName(id)
		    into l_Ministry
		  from unit
		  where id = :p_min_id;
		  
		  return(l_Ministry);
		  
			exception when no_data_found then 
			  return ('Ministry not Found');
		end;
	else
		return('Awaiting Parameter Form Change for display of ministry name');
	end if;
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[beforereport]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function BeforeReport return boolean is
begin
  :cp_strategy_id := :p_object_id;
	begin
	  select acronym 
	  into :cp_ministry_acronym
	  from unit
	  where id = :p_min_id;
	end;
  return (TRUE);
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[b_11formattrigger]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function B_11FormatTrigger return boolean is
begin
	if upper(:file_reporting_status) = 'ON TRACK' then  -- 'GREEN' then  -- {{ONTrack}}
	    srw.set_foreground_fill_color('r50g88b50');
	    srw.set_text_color('r50g88b50');
	    srw.set_fill_pattern('solid');
	elsif upper(:file_reporting_status) = 'CONCERNS' then -- 'YELLOW' then --{{Concerns}}
	    srw.set_foreground_fill_color('r100g100b0');
	    srw.set_text_color('r100g100b0');
	    srw.set_fill_pattern('solid');
	elsif upper(:file_reporting_status) = 'ATTENTION' then --'RED' then --{{Immediate Attention}}
	    srw.set_foreground_fill_color('r100g0b0');
	    srw.set_text_color('r100g0b0');
	    srw.set_fill_pattern('solid');
	elsif upper(:file_reporting_status) = 'COMPLETED' then --'BLACK' then --{{Complete}}
	    srw.set_foreground_fill_color('black');
	    srw.set_fill_pattern('solid');
	elsif upper(:file_reporting_status) = 'CANCELLED' then  --'GRAY' then  --{{Cancelled}}
	    srw.set_foreground_fill_color('gray24');
	    srw.set_fill_pattern('solid');
	elsif upper(:file_reporting_status) = 'DEFERRED' then  --'WHITE' 
	    srw.set_foreground_fill_color('white');
	    srw.set_fill_pattern('solid');
	else 
		return (FALSE);
	end if;
  
  return (TRUE);
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[b_1formattrigger]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function B_1FormatTrigger return boolean is
begin
	if upper(:strat_rs) = 'ON TRACK' then  -- 'GREEN' then  -- {{ONTrack}}
	    srw.set_foreground_fill_color('r50g88b50');
	    srw.set_text_color('r50g88b50');
	    srw.set_fill_pattern('solid');
	elsif upper(:strat_rs) = 'CONCERNS' then -- 'YELLOW' then --{{Concerns}}
	    srw.set_foreground_fill_color('r100g100b0');
	    srw.set_text_color('r100g100b0');
	    srw.set_fill_pattern('solid');
	elsif upper(:strat_rs) = 'ATTENTION' then --'RED' then --{{Immediate Attention}}
	    srw.set_foreground_fill_color('r100g0b0');
	    srw.set_text_color('r100g0b0');
	    srw.set_fill_pattern('solid');
	elsif upper(:strat_rs) = 'COMPLETED' then --'BLACK' then --{{Complete}}
	    srw.set_foreground_fill_color('black');
	    srw.set_fill_pattern('solid');
	elsif upper(:strat_rs) = 'CANCELLED' then  --'GRAY' then  --{{Cancelled}}
	    srw.set_foreground_fill_color('gray24');
	    srw.set_fill_pattern('solid');
	elsif upper(:strat_rs) = 'DEFERRED' then  --'WHITE' then 
	    srw.set_foreground_fill_color('white');
	    srw.set_fill_pattern('solid');
	else 
		return (FALSE);
	end if;
  
  return (TRUE);
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[m_related_filesformattrigger]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function M_RELATED_FILESFormatTrigger return boolean is
begin

  -- Automatically Generated from Report Builder.
  if (:CS_CNT_RELATED_FILES = '0')
  then
    return (FALSE);
  end if;

  return (TRUE);
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[m_g_documents_sectionformattri]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function M_G_DOCUMENTS_SECTIONFormatTri return boolean is
begin

  -- Automatically Generated from Report Builder.
  if (:CS_CNT_DOCUMENTS = '0')
  then
    return (FALSE);
  end if;

  return (TRUE);
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[m_contactsformattrigger]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function M_CONTACTSFormatTrigger return boolean is
begin

  -- Automatically Generated from Report Builder.
  if (:CS_CNT_CONTACTS = '0')
  then
    return (FALSE);
  end if;

  return (TRUE);
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[m_graph_data_tabular_viewforma]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function M_GRAPH_DATA_TABULAR_VIEWForma return boolean is
begin

  -- Automatically Generated from Report Builder.
  if (:CS_ACT_AND_TARGET_DATA_CNT = '0')
  then
    return (FALSE);
  end if;

  return (TRUE);
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[b_no_metrics_yet_msgformattrig]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function B_NO_METRICS_YET_MSGFormatTrig return boolean is
begin

  -- Automatically Generated from Report Builder.
  if (:CS_ACT_AND_TARGET_DATA_CNT > '0')
  then
    return (FALSE);
  end if;

  return (TRUE);
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[cf_data_valuesformula]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Return Type:"><![CDATA[character]]></Property>
				<Property Name="Formula:"><![CDATA[function CF_DATA_VALUESFormula return Char is


	--i_series_cnt integer						:= 2;
	DATA_VALUES  VARCHAR2(200)			:= 'ACTUAL_VALUE1,TARGET_VALUE1';
	s_range_or_single varchar2(50)	:= 'Singular' ;

begin
  
  
	-- 26-JAN-2009 		S T A R T  ********************************************************************************************************
	
	-- the commented out query below (select count ...) does not make much sense anymore. As of Rel 3.0 there will be only one graphing data per measure. 
	-- ( don't know what will happen when two users concurrently execute plotting a graph for the same measure	)
	-- Anyway, today I will change the value returned from this function. It will be either 'ACTUAL_VALUE1,TARGET_VALUE1'
	-- or 'ACTUAL_VALUE1,TARGET_VALUE1,TARGET_HIGH_VALUE' for target portfolio 'definition' equals to 'Singular' or 'Range' respectively.
		
  
  select vl.title 
   into s_range_or_single   
      from value_list vl, m_target_portfolio tp, m_graphing g
	  where vl.type = 'MEASURE_TARGET_DEFINITION'
	  and tp.definition_id = vl.id
	   and g.measure_id = tp.measure_id
	   and tp.measure_id = :MEASUREMENT_ID	
	   and g.target_portfolio_id = tp.id;
	
	if s_range_or_single = 'Range' then
		DATA_VALUES := DATA_VALUES || ',TARGET_HIGH_VALUE';
	end if;	
	
	-- 26-JAN-2009 		E N D   ************************************************************************************************************
   
  RETURN DATA_VALUES;
  
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[cf_graph_subtitle_textformula]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Return Type:"><![CDATA[character]]></Property>
				<Property Name="Formula:"><![CDATA[function CF_GRAPH_SUBTITLE_TEXTFormula return Char is
begin
  return SUBSTR( ('Measure (' || :meas_title || ')'), 1, 50 );
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[cf_graph_title_textformula]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Return Type:"><![CDATA[character]]></Property>
				<Property Name="Formula:"><![CDATA[function CF_GRAPH_TITLE_TEXTFormula return Char is

	entity_type varchar(20);

begin
  
  select title into entity_type from easy_domain where id = 3;
 
  return entity_type || ' (' || :business_number || ')';  
  
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[ct_1formattrigger]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function CT_1FormatTrigger return boolean is
begin
	-- If drawing user-supplied graph image, or if there is
  -- no graphing data, hide the graph object.

  -- JK TEST fix graph problem 
  if (:CS_TYPE_OF_GRAPH_IMAGE != 'System Generated'
  	  or :CS_Count_Graph_Table_Rows = 0)
  then
    return (FALSE);
  end if;
  
      
  return (TRUE);
end;

    
]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[r_image1formattrigger]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function R_IMAGE1FormatTrigger return boolean is
begin
  
   if (:CS_TYPE_OF_GRAPH_IMAGE = 'System Generated')
  then
    return (FALSE);
  end if;
  
  
  return (TRUE);
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[b_chart_rep_status_symbol1form]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function B_Chart_Rep_Status_Symbol1Form return boolean is
begin
	
  if upper(:chart_reporting_status) = 'ON TRACK' then  -- 'GREEN' then  -- {{ONTrack}}
    srw.set_foreground_fill_color('r50g88b50');
    srw.set_text_color('r50g88b50');
    srw.set_fill_pattern('solid');
elsif upper(:chart_reporting_status) = 'CONCERNS' then -- 'YELLOW' then --{{Concerns}}
    srw.set_foreground_fill_color('r100g100b0');
    srw.set_text_color('r100g100b0');
    srw.set_fill_pattern('solid');
elsif upper(:chart_reporting_status) = 'ATTENTION' then --'RED' then --{{Immediate Attention}}
    srw.set_foreground_fill_color('r100g0b0');
    srw.set_text_color('r100g0b0');
    srw.set_fill_pattern('solid');
elsif upper(:chart_reporting_status) = 'COMPLETED' then --'BLACK' then --{{Complete}}
    srw.set_foreground_fill_color('black');
    srw.set_fill_pattern('solid');
elsif upper(:chart_reporting_status) = 'CANCELLED' then  --'GRAY' then  --{{Cancelled}}
    srw.set_foreground_fill_color('gray24');
    srw.set_fill_pattern('solid');
elsif upper(:chart_reporting_status) = 'DEFERRED' then  --'WHITE' then  --{{Unable to Report}}
    srw.set_foreground_fill_color('white');
    srw.set_fill_pattern('solid');
end if;
  return (TRUE);
  
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[b_related_measures1formattrigg]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function B_RELATED_MEASURES1FormatTrigg return boolean is
begin

  -- Automatically Generated from Report Builder.

  if (:CS_Chart_Count = '0')
  then
    return (FALSE);
  end if;

  return (TRUE);
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[cf_actual_category_scopeformul]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Return Type:"><![CDATA[character]]></Property>
				<Property Name="Formula:"><![CDATA[function CF_Actual_Category_ScopeFormul return Char is
begin
  return(substr(:category_scope, 2));
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[m_13formattrigger]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function M_13FormatTrigger return boolean is
begin

  -- Automatically Generated from Report Builder.
  if (:CS_Chart_Count < '1')
  then
    return (FALSE);
  end if;

  return (TRUE);
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[b_contacts_section_title1forma]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function B_CONTACTS_SECTION_TITLE1Forma return boolean is
begin

  -- Automatically Generated from Report Builder.
  if (:CS_Measure_Count < '1')
  then
    return (FALSE);
  end if;

  return (TRUE);
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[f_chart_col1formattrigger]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function F_chart_col1FormatTrigger return boolean is

	style_num     NUMBER(10)   := 0;
	
	l_BG_COLOR    VARCHAR2(50) := '' ;
	l_TEXT_COLOR  VARCHAR2(50) := '' ;
	l_BOLD        NUMBER(1) := 0;
	l_ITALIC      NUMBER(1) := 0;
	l_UNDERLINE   NUMBER(1) := 0;
	l_ALIGNMENT   VARCHAR2(50) := '';	
	l_BORDER      NUMBER(1) := 0;
	-- this change for every columns
	l_this_column NUMBER(1) := 0;

	l_chart_style NUMBER(38) ;
	l_row_style NUMBER(38) ;
	l_column_style NUMBER(38) ;
	l_cell_style NUMBER(38) ;


begin  
  
  
  
  -- order in precedence (form least significant to most significant) is as following:
  -- chart -> column -> row -> cell
  -- meaning, id cell has a style id defined, use cell style info

  -- JK Jan 28 2009 9(1): 
  -- This snippet *was* cloned from ChartSummary.rdf file, F_Data field, but it got changed today - big time. 
  -- all styles are being retrieved here
    	
  -- JK Jan 28 2009 (2):  add handler for BORDER attribute	

  style_num := 0;    	
  
  
select 
  cl3.style_id
into
  l_cell_style	  
from 
  m_chart c3, 
  chart_column co3, 
  chart_row ro3, 
  chart_cell cl3
where 
  c3.id = :basic_chart_id
  and co3.chart_data_id = c3.chart_data_id
	and co3.column_number = l_this_column
  and ro3.chart_data_id = c3.chart_data_id 
  and ro3.row_number = :chart_row_number
  and cl3.chart_data_id = c3.chart_data_id
  and cl3.chart_row_id = ro3.id
	and cl3.chart_column_id = co3.id;
	 
  
      

  IF l_cell_style is not null AND l_cell_style > 0 THEN
		style_num := l_cell_style;
  END IF;	
  
   
  	
	-- if we have style defined, retrieve the attributes from M_STYLE table
	IF style_num is not null AND  style_num > 0 THEN
				
		
		SELECT
  	 map1.REPORT_COLOR_CODE  as BG_COLOR,
  	 map2.REPORT_COLOR_CODE as TEXT_COLOR,
  	 BOLD        ,
  	 ITALIC      ,
  	 UNDERLINE   ,
  	 ALIGNMENT   ,
  	 BORDER
	  INTO
		 l_BG_COLOR,
		 l_TEXT_COLOR,
		 l_BOLD      ,
		 l_ITALIC     ,
		 l_UNDERLINE  ,
		 l_ALIGNMENT  ,
		 l_BORDER
	  FROM chart_STYLE		
	  , M_COLORS_MAP map1
	  , M_COLORS_MAP map2
	  WHERE id = style_num
	  and lower(trim(map1.RGB_COLOR_CODE(+))) = lower(trim(BG_COLOR))
	  and lower(trim(map2.RGB_COLOR_CODE(+))) = lower(trim(TEXT_COLOR)) ;			  
	  
	  --SRW.MESSAGE(999, 'values are ' || l_BG_COLOR || l_TEXT_COLOR || l_BOLD || l_ITALIC  || l_UNDERLINE || l_ALIGNMENT  );
	  
	  -- take the style retrieved and do SRW.SET calls
	  	  
	  IF l_BG_COLOR is not null  and LENGTH(l_BG_COLOR) >0 THEN
    	SRW.SET_FOREGROUND_FILL_COLOR(l_BG_COLOR);  
    	srw.set_fill_pattern('solid');
    	--SRW.MESSAGE(999, 'row ' || to_char(:row_number) || ' column number ' || to_char(:column_number) || ', changing BG color to ' || l_BG_COLOR );	  
   
	  END IF;	
	  
		IF l_TEXT_COLOR is not null AND  LENGTH(l_TEXT_COLOR) > 0 THEN	  	
    	SRW.SET_TEXT_COLOR(l_TEXT_COLOR);  
    	--SRW.MESSAGE(999, 'row ' || to_char(:row_number) || ' column number ' || to_char(:column_number) || ' changing color to ' || l_TEXT_COLOR );
	  END IF;		  	
	  
		IF l_BOLD is not null AND  l_BOLD = 1 THEN	  	
    	SRW.SET_FONT_WEIGHT(SRW.BOLD_WEIGHT);
	  END IF;  	
	  
		IF l_ITALIC is not null AND  l_ITALIC = 1 THEN	  	
    	SRW.SET_FONT_STYLE(SRW.ITALIC_STYLE);
	  END IF;	 	
	  
		IF l_UNDERLINE is not null AND  l_UNDERLINE = 1 THEN	  	
    	SRW.SET_FONT_STYLE(SRW.UNDERLINE_STYLE);
	  END IF;	
	  
		IF l_ALIGNMENT is not null AND  LENGTH(l_ALIGNMENT) > 0 THEN	  	
    	SRW.SET_JUSTIFICATION( SRW.CENTER_HJUST );  
		END IF;	
				
		IF l_BORDER is not null and l_BORDER = 1 THEN	  	    	
    	srw.set_foreground_border_color('black');
    	srw.set_border_pattern('solid');
	  END IF;	

	
	END IF;	
	
	-- no style is defined, exit from here and leave everything at its defaults
	return (TRUE);
	
	exception 		
		when no_data_found then
			return (TRUE);
	
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[f_chart_col2formattrigger]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function F_chart_col2FormatTrigger return boolean is

style_num     NUMBER(10)   := 0;
	
	l_BG_COLOR    VARCHAR2(50) := '' ;
	l_TEXT_COLOR  VARCHAR2(50) := '' ;
	l_BOLD        NUMBER(1) := 0;
	l_ITALIC      NUMBER(1) := 0;
	l_UNDERLINE   NUMBER(1) := 0;
	l_ALIGNMENT   VARCHAR2(50) := '';	
	l_BORDER      NUMBER(1) := 0;
	-- this change for every columns
	l_this_column NUMBER(1) := 1;

	l_chart_style NUMBER(38) ;
	l_row_style NUMBER(38) ;
	l_column_style NUMBER(38) ;
	l_cell_style NUMBER(38) ;


begin  
  
  
  
  -- order in precedence (form least significant to most significant) is as following:
  -- chart -> column -> row -> cell
  -- meaning, id cell has a style id defined, use cell style info

  -- JK Jan 28 2009 9(1): 
  -- This snippet *was* cloned from ChartSummary.rdf file, F_Data field, but it got changed today - big time. 
  -- all styles are being retrieved here
    	
  -- JK Jan 28 2009 (2):  add handler for BORDER attribute	

  style_num := 0;    	
  
select 
  cl3.style_id
into
  l_cell_style	  
from 
  m_chart c3, 
  chart_column co3, 
  chart_row ro3, 
  chart_cell cl3
where 
  c3.id = :basic_chart_id
  and co3.chart_data_id = c3.chart_data_id
	and co3.column_number = l_this_column
  and ro3.chart_data_id = c3.chart_data_id 
  and ro3.row_number = :chart_row_number
  and cl3.chart_data_id = c3.chart_data_id
  and cl3.chart_row_id = ro3.id
	and cl3.chart_column_id = co3.id;
	 
  
      
  
  IF l_cell_style is not null AND l_cell_style > 0 THEN
		style_num := l_cell_style;
  END IF;	
  
   
  	
	-- if we have style defined, retrieve the attributes from M_STYLE table
	IF style_num is not null AND  style_num > 0 THEN
				
		
		SELECT
  	 map1.REPORT_COLOR_CODE  as BG_COLOR,
  	 map2.REPORT_COLOR_CODE as TEXT_COLOR,
  	 BOLD        ,
  	 ITALIC      ,
  	 UNDERLINE   ,
  	 ALIGNMENT   ,
  	 BORDER
	  INTO
		 l_BG_COLOR,
		 l_TEXT_COLOR,
		 l_BOLD      ,
		 l_ITALIC     ,
		 l_UNDERLINE  ,
		 l_ALIGNMENT  ,
		 l_BORDER
	  FROM chart_STYLE		
	  , M_COLORS_MAP map1
	  , M_COLORS_MAP map2
	  WHERE id = style_num
	  and lower(trim(map1.RGB_COLOR_CODE(+))) = lower(trim(BG_COLOR))
	  and lower(trim(map2.RGB_COLOR_CODE(+))) = lower(trim(TEXT_COLOR)) ;			  
	  
	  --SRW.MESSAGE(999, 'values are ' || l_BG_COLOR || l_TEXT_COLOR || l_BOLD || l_ITALIC  || l_UNDERLINE || l_ALIGNMENT  );
	  
	  -- take the style retrieved and do SRW.SET calls
	  	  
	  IF l_BG_COLOR is not null  and LENGTH(l_BG_COLOR) >0 THEN
    	SRW.SET_FOREGROUND_FILL_COLOR(l_BG_COLOR);  
    	srw.set_fill_pattern('solid');
    	--SRW.MESSAGE(999, 'row ' || to_char(:row_number) || ' column number ' || to_char(:column_number) || ', changing BG color to ' || l_BG_COLOR );	  
   
	  END IF;	
	  
		IF l_TEXT_COLOR is not null AND  LENGTH(l_TEXT_COLOR) > 0 THEN	  	
    	SRW.SET_TEXT_COLOR(l_TEXT_COLOR);  
    	--SRW.MESSAGE(999, 'row ' || to_char(:row_number) || ' column number ' || to_char(:column_number) || ' changing color to ' || l_TEXT_COLOR );
	  END IF;		  	
	  
		IF l_BOLD is not null AND  l_BOLD = 1 THEN	  	
    	SRW.SET_FONT_WEIGHT(SRW.BOLD_WEIGHT);
	  END IF;  	
	  
		IF l_ITALIC is not null AND  l_ITALIC = 1 THEN	  	
    	SRW.SET_FONT_STYLE(SRW.ITALIC_STYLE);
	  END IF;	 	
	  
		IF l_UNDERLINE is not null AND  l_UNDERLINE = 1 THEN	  	
    	SRW.SET_FONT_STYLE(SRW.UNDERLINE_STYLE);
	  END IF;	
	  
		IF l_ALIGNMENT is not null AND  LENGTH(l_ALIGNMENT) > 0 THEN	  	
    	SRW.SET_JUSTIFICATION( SRW.CENTER_HJUST );  
		END IF;	
				
		IF l_BORDER is not null and l_BORDER = 1 THEN	  	    	
    	srw.set_foreground_border_color('black');
    	srw.set_border_pattern('solid');
	  END IF;	

	
	END IF;	
	
	-- no style is defined, exit from here and leave everything at its defaults
	return (TRUE);
	
	exception 		
		when no_data_found then
			return (TRUE);
	
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[f_chart_col3formattrigger]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function F_chart_col3FormatTrigger return boolean is

style_num     NUMBER(10)   := 0;
	
	l_BG_COLOR    VARCHAR2(50) := '' ;
	l_TEXT_COLOR  VARCHAR2(50) := '' ;
	l_BOLD        NUMBER(1) := 0;
	l_ITALIC      NUMBER(1) := 0;
	l_UNDERLINE   NUMBER(1) := 0;
	l_ALIGNMENT   VARCHAR2(50) := '';	
	l_BORDER      NUMBER(1) := 0;
	-- this change for every columns
	l_this_column NUMBER(1) := 2;

	l_chart_style NUMBER(38) ;
	l_row_style NUMBER(38) ;
	l_column_style NUMBER(38) ;
	l_cell_style NUMBER(38) ;


begin  
  
  
  
  -- order in precedence (form least significant to most significant) is as following:
  -- chart -> column -> row -> cell
  -- meaning, id cell has a style id defined, use cell style info

  -- JK Jan 28 2009 9(1): 
  -- This snippet *was* cloned from ChartSummary.rdf file, F_Data field, but it got changed today - big time. 
  -- all styles are being retrieved here
    	
  -- JK Jan 28 2009 (2):  add handler for BORDER attribute	

  style_num := 0;    	
  
 select 
  cl3.style_id
into
  l_cell_style	  
from 
  m_chart c3, 
  chart_column co3, 
  chart_row ro3, 
  chart_cell cl3
where 
  c3.id = :basic_chart_id
  and co3.chart_data_id = c3.chart_data_id
	and co3.column_number = l_this_column
  and ro3.chart_data_id = c3.chart_data_id 
  and ro3.row_number = :chart_row_number
  and cl3.chart_data_id = c3.chart_data_id
  and cl3.chart_row_id = ro3.id
	and cl3.chart_column_id = co3.id;
      
  IF l_cell_style is not null AND l_cell_style > 0 THEN
		style_num := l_cell_style;
  END IF;	
  
   
  	
	-- if we have style defined, retrieve the attributes from M_STYLE table
	IF style_num is not null AND  style_num > 0 THEN
				
		
		SELECT
  	 map1.REPORT_COLOR_CODE  as BG_COLOR,
  	 map2.REPORT_COLOR_CODE as TEXT_COLOR,
  	 BOLD        ,
  	 ITALIC      ,
  	 UNDERLINE   ,
  	 ALIGNMENT   ,
  	 BORDER
	  INTO
		 l_BG_COLOR,
		 l_TEXT_COLOR,
		 l_BOLD      ,
		 l_ITALIC     ,
		 l_UNDERLINE  ,
		 l_ALIGNMENT  ,
		 l_BORDER
	  FROM chart_STYLE		
	  , M_COLORS_MAP map1
	  , M_COLORS_MAP map2
	  WHERE id = style_num
	  and lower(trim(map1.RGB_COLOR_CODE(+))) = lower(trim(BG_COLOR))
	  and lower(trim(map2.RGB_COLOR_CODE(+))) = lower(trim(TEXT_COLOR)) ;			  
	  
	  --SRW.MESSAGE(999, 'values are ' || l_BG_COLOR || l_TEXT_COLOR || l_BOLD || l_ITALIC  || l_UNDERLINE || l_ALIGNMENT  );
	  
	  -- take the style retrieved and do SRW.SET calls
	  	  
	  IF l_BG_COLOR is not null  and LENGTH(l_BG_COLOR) >0 THEN
    	SRW.SET_FOREGROUND_FILL_COLOR(l_BG_COLOR);  
    	srw.set_fill_pattern('solid');
    	--SRW.MESSAGE(999, 'row ' || to_char(:row_number) || ' column number ' || to_char(:column_number) || ', changing BG color to ' || l_BG_COLOR );	  
   
	  END IF;	
	  
		IF l_TEXT_COLOR is not null AND  LENGTH(l_TEXT_COLOR) > 0 THEN	  	
    	SRW.SET_TEXT_COLOR(l_TEXT_COLOR);  
    	--SRW.MESSAGE(999, 'row ' || to_char(:row_number) || ' column number ' || to_char(:column_number) || ' changing color to ' || l_TEXT_COLOR );
	  END IF;		  	
	  
		IF l_BOLD is not null AND  l_BOLD = 1 THEN	  	
    	SRW.SET_FONT_WEIGHT(SRW.BOLD_WEIGHT);
	  END IF;  	
	  
		IF l_ITALIC is not null AND  l_ITALIC = 1 THEN	  	
    	SRW.SET_FONT_STYLE(SRW.ITALIC_STYLE);
	  END IF;	 	
	  
		IF l_UNDERLINE is not null AND  l_UNDERLINE = 1 THEN	  	
    	SRW.SET_FONT_STYLE(SRW.UNDERLINE_STYLE);
	  END IF;	
	  
		IF l_ALIGNMENT is not null AND  LENGTH(l_ALIGNMENT) > 0 THEN	  	
    	SRW.SET_JUSTIFICATION( SRW.CENTER_HJUST );  
		END IF;	
				
		IF l_BORDER is not null and l_BORDER = 1 THEN	  	    	
    	srw.set_foreground_border_color('black');
    	srw.set_border_pattern('solid');
	  END IF;	

	
	END IF;	
	
	-- no style is defined, exit from here and leave everything at its defaults
	return (TRUE);
	
	exception 		
		when no_data_found then
			return (TRUE);
	
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[f_chart_col4formattrigger]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function F_chart_col4FormatTrigger return boolean is

style_num     NUMBER(10)   := 0;
	
	l_BG_COLOR    VARCHAR2(50) := '' ;
	l_TEXT_COLOR  VARCHAR2(50) := '' ;
	l_BOLD        NUMBER(1) := 0;
	l_ITALIC      NUMBER(1) := 0;
	l_UNDERLINE   NUMBER(1) := 0;
	l_ALIGNMENT   VARCHAR2(50) := '';	
	l_BORDER      NUMBER(1) := 0;
	-- this change for every columns
	l_this_column NUMBER(1) := 3;

	l_chart_style NUMBER(38) ;
	l_row_style NUMBER(38) ;
	l_column_style NUMBER(38) ;
	l_cell_style NUMBER(38) ;


begin  
  
  
  
  -- order in precedence (form least significant to most significant) is as following:
  -- chart -> column -> row -> cell
  -- meaning, id cell has a style id defined, use cell style info

  -- JK Jan 28 2009 9(1): 
  -- This snippet *was* cloned from ChartSummary.rdf file, F_Data field, but it got changed today - big time. 
  -- all styles are being retrieved here
    	
  -- JK Jan 28 2009 (2):  add handler for BORDER attribute	

  style_num := 0;    	
  
  
select 
  cl3.style_id
into
  l_cell_style	  
from 
  m_chart c3, 
  chart_column co3, 
  chart_row ro3, 
  chart_cell cl3
where 
  c3.id = :basic_chart_id
  and co3.chart_data_id = c3.chart_data_id
	and co3.column_number = l_this_column
  and ro3.chart_data_id = c3.chart_data_id 
  and ro3.row_number = :chart_row_number
  and cl3.chart_data_id = c3.chart_data_id
  and cl3.chart_row_id = ro3.id
	and cl3.chart_column_id = co3.id;
      
  
  IF l_cell_style is not null AND l_cell_style > 0 THEN
		style_num := l_cell_style;
  END IF;	
  
   
  	
	-- if we have style defined, retrieve the attributes from M_STYLE table
	IF style_num is not null AND  style_num > 0 THEN
				
		
		SELECT
  	 map1.REPORT_COLOR_CODE  as BG_COLOR,
  	 map2.REPORT_COLOR_CODE as TEXT_COLOR,
  	 BOLD        ,
  	 ITALIC      ,
  	 UNDERLINE   ,
  	 ALIGNMENT   ,
  	 BORDER
	  INTO
		 l_BG_COLOR,
		 l_TEXT_COLOR,
		 l_BOLD      ,
		 l_ITALIC     ,
		 l_UNDERLINE  ,
		 l_ALIGNMENT  ,
		 l_BORDER
	  FROM chart_STYLE		
	  , M_COLORS_MAP map1
	  , M_COLORS_MAP map2
	  WHERE id = style_num
	  and lower(trim(map1.RGB_COLOR_CODE(+))) = lower(trim(BG_COLOR))
	  and lower(trim(map2.RGB_COLOR_CODE(+))) = lower(trim(TEXT_COLOR)) ;			  
	  
	  --SRW.MESSAGE(999, 'values are ' || l_BG_COLOR || l_TEXT_COLOR || l_BOLD || l_ITALIC  || l_UNDERLINE || l_ALIGNMENT  );
	  
	  -- take the style retrieved and do SRW.SET calls
	  	  
	  IF l_BG_COLOR is not null  and LENGTH(l_BG_COLOR) >0 THEN
    	SRW.SET_FOREGROUND_FILL_COLOR(l_BG_COLOR);  
    	srw.set_fill_pattern('solid');
    	--SRW.MESSAGE(999, 'row ' || to_char(:row_number) || ' column number ' || to_char(:column_number) || ', changing BG color to ' || l_BG_COLOR );	  
   
	  END IF;	
	  
		IF l_TEXT_COLOR is not null AND  LENGTH(l_TEXT_COLOR) > 0 THEN	  	
    	SRW.SET_TEXT_COLOR(l_TEXT_COLOR);  
    	--SRW.MESSAGE(999, 'row ' || to_char(:row_number) || ' column number ' || to_char(:column_number) || ' changing color to ' || l_TEXT_COLOR );
	  END IF;		  	
	  
		IF l_BOLD is not null AND  l_BOLD = 1 THEN	  	
    	SRW.SET_FONT_WEIGHT(SRW.BOLD_WEIGHT);
	  END IF;  	
	  
		IF l_ITALIC is not null AND  l_ITALIC = 1 THEN	  	
    	SRW.SET_FONT_STYLE(SRW.ITALIC_STYLE);
	  END IF;	 	
	  
		IF l_UNDERLINE is not null AND  l_UNDERLINE = 1 THEN	  	
    	SRW.SET_FONT_STYLE(SRW.UNDERLINE_STYLE);
	  END IF;	
	  
		IF l_ALIGNMENT is not null AND  LENGTH(l_ALIGNMENT) > 0 THEN	  	
    	SRW.SET_JUSTIFICATION( SRW.CENTER_HJUST );  
		END IF;	
				
		IF l_BORDER is not null and l_BORDER = 1 THEN	  	    	
    	srw.set_foreground_border_color('black');
    	srw.set_border_pattern('solid');
	  END IF;	

	
	END IF;	
	
	-- no style is defined, exit from here and leave everything at its defaults
	return (TRUE);
	
	exception 		
		when no_data_found then
			return (TRUE);
	
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[f_chart_col5formattrigger]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function F_chart_col5FormatTrigger return boolean is

style_num     NUMBER(10)   := 0;
	
	l_BG_COLOR    VARCHAR2(50) := '' ;
	l_TEXT_COLOR  VARCHAR2(50) := '' ;
	l_BOLD        NUMBER(1) := 0;
	l_ITALIC      NUMBER(1) := 0;
	l_UNDERLINE   NUMBER(1) := 0;
	l_ALIGNMENT   VARCHAR2(50) := '';	
	l_BORDER      NUMBER(1) := 0;
	-- this change for every columns
	l_this_column NUMBER(1) := 4;

	l_chart_style NUMBER(38) ;
	l_row_style NUMBER(38) ;
	l_column_style NUMBER(38) ;
	l_cell_style NUMBER(38) ;


begin  
  
  
  
  -- order in precedence (form least significant to most significant) is as following:
  -- chart -> column -> row -> cell
  -- meaning, id cell has a style id defined, use cell style info

  -- JK Jan 28 2009 9(1): 
  -- This snippet *was* cloned from ChartSummary.rdf file, F_Data field, but it got changed today - big time. 
  -- all styles are being retrieved here
    	
  -- JK Jan 28 2009 (2):  add handler for BORDER attribute	

  style_num := 0;    	
  
select 
  cl3.style_id
into
  l_cell_style	  
from 
  m_chart c3, 
  chart_column co3, 
  chart_row ro3, 
  chart_cell cl3
where 
  c3.id = :basic_chart_id
  and co3.chart_data_id = c3.chart_data_id
	and co3.column_number = l_this_column
  and ro3.chart_data_id = c3.chart_data_id 
  and ro3.row_number = :chart_row_number
  and cl3.chart_data_id = c3.chart_data_id
  and cl3.chart_row_id = ro3.id
	and cl3.chart_column_id = co3.id;

  
  IF l_cell_style is not null AND l_cell_style > 0 THEN
		style_num := l_cell_style;
  END IF;	
  
   
  	
	-- if we have style defined, retrieve the attributes from M_STYLE table
	IF style_num is not null AND  style_num > 0 THEN
				
		
		SELECT
  	 map1.REPORT_COLOR_CODE  as BG_COLOR,
  	 map2.REPORT_COLOR_CODE as TEXT_COLOR,
  	 BOLD        ,
  	 ITALIC      ,
  	 UNDERLINE   ,
  	 ALIGNMENT   ,
  	 BORDER
	  INTO
		 l_BG_COLOR,
		 l_TEXT_COLOR,
		 l_BOLD      ,
		 l_ITALIC     ,
		 l_UNDERLINE  ,
		 l_ALIGNMENT  ,
		 l_BORDER
	  FROM chart_STYLE		
	  , M_COLORS_MAP map1
	  , M_COLORS_MAP map2
	  WHERE id = style_num
	  and lower(trim(map1.RGB_COLOR_CODE(+))) = lower(trim(BG_COLOR))
	  and lower(trim(map2.RGB_COLOR_CODE(+))) = lower(trim(TEXT_COLOR)) ;			  
	  
	  --SRW.MESSAGE(999, 'values are ' || l_BG_COLOR || l_TEXT_COLOR || l_BOLD || l_ITALIC  || l_UNDERLINE || l_ALIGNMENT  );
	  
	  -- take the style retrieved and do SRW.SET calls
	  	  
	  IF l_BG_COLOR is not null  and LENGTH(l_BG_COLOR) >0 THEN
    	SRW.SET_FOREGROUND_FILL_COLOR(l_BG_COLOR);  
    	srw.set_fill_pattern('solid');
    	--SRW.MESSAGE(999, 'row ' || to_char(:row_number) || ' column number ' || to_char(:column_number) || ', changing BG color to ' || l_BG_COLOR );	  
   
	  END IF;	
	  
		IF l_TEXT_COLOR is not null AND  LENGTH(l_TEXT_COLOR) > 0 THEN	  	
    	SRW.SET_TEXT_COLOR(l_TEXT_COLOR);  
    	--SRW.MESSAGE(999, 'row ' || to_char(:row_number) || ' column number ' || to_char(:column_number) || ' changing color to ' || l_TEXT_COLOR );
	  END IF;		  	
	  
		IF l_BOLD is not null AND  l_BOLD = 1 THEN	  	
    	SRW.SET_FONT_WEIGHT(SRW.BOLD_WEIGHT);
	  END IF;  	
	  
		IF l_ITALIC is not null AND  l_ITALIC = 1 THEN	  	
    	SRW.SET_FONT_STYLE(SRW.ITALIC_STYLE);
	  END IF;	 	
	  
		IF l_UNDERLINE is not null AND  l_UNDERLINE = 1 THEN	  	
    	SRW.SET_FONT_STYLE(SRW.UNDERLINE_STYLE);
	  END IF;	
	  
		IF l_ALIGNMENT is not null AND  LENGTH(l_ALIGNMENT) > 0 THEN	  	
    	SRW.SET_JUSTIFICATION( SRW.CENTER_HJUST );  
		END IF;	
				
		IF l_BORDER is not null and l_BORDER = 1 THEN	  	    	
    	srw.set_foreground_border_color('black');
    	srw.set_border_pattern('solid');
	  END IF;	

	
	END IF;	
	
	-- no style is defined, exit from here and leave everything at its defaults
	return (TRUE);
	
	exception 		
		when no_data_found then
			return (TRUE);
	
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[f_chart_col6formattrigger]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function F_chart_col6FormatTrigger return boolean is

style_num     NUMBER(10)   := 0;
	
	l_BG_COLOR    VARCHAR2(50) := '' ;
	l_TEXT_COLOR  VARCHAR2(50) := '' ;
	l_BOLD        NUMBER(1) := 0;
	l_ITALIC      NUMBER(1) := 0;
	l_UNDERLINE   NUMBER(1) := 0;
	l_ALIGNMENT   VARCHAR2(50) := '';	
	l_BORDER      NUMBER(1) := 0;
	-- this change for every columns
	l_this_column NUMBER(1) := 5;

	l_chart_style NUMBER(38) ;
	l_row_style NUMBER(38) ;
	l_column_style NUMBER(38) ;
	l_cell_style NUMBER(38) ;


begin  
  
  
  
  -- order in precedence (form least significant to most significant) is as following:
  -- chart -> column -> row -> cell
  -- meaning, id cell has a style id defined, use cell style info

  -- JK Jan 28 2009 9(1): 
  -- This snippet *was* cloned from ChartSummary.rdf file, F_Data field, but it got changed today - big time. 
  -- all styles are being retrieved here
    	
  -- JK Jan 28 2009 (2):  add handler for BORDER attribute	

  style_num := 0;    	
  
 select 
  cl3.style_id
into
  l_cell_style	  
from 
  m_chart c3, 
  chart_column co3, 
  chart_row ro3, 
  chart_cell cl3
where 
  c3.id = :basic_chart_id
  and co3.chart_data_id = c3.chart_data_id
	and co3.column_number = l_this_column
  and ro3.chart_data_id = c3.chart_data_id 
  and ro3.row_number = :chart_row_number
  and cl3.chart_data_id = c3.chart_data_id
  and cl3.chart_row_id = ro3.id
	and cl3.chart_column_id = co3.id;
      
  IF l_cell_style is not null AND l_cell_style > 0 THEN
		style_num := l_cell_style;
  END IF;	
  
   
  	
	-- if we have style defined, retrieve the attributes from M_STYLE table
	IF style_num is not null AND  style_num > 0 THEN
				
		
		SELECT
  	 map1.REPORT_COLOR_CODE  as BG_COLOR,
  	 map2.REPORT_COLOR_CODE as TEXT_COLOR,
  	 BOLD        ,
  	 ITALIC      ,
  	 UNDERLINE   ,
  	 ALIGNMENT   ,
  	 BORDER
	  INTO
		 l_BG_COLOR,
		 l_TEXT_COLOR,
		 l_BOLD      ,
		 l_ITALIC     ,
		 l_UNDERLINE  ,
		 l_ALIGNMENT  ,
		 l_BORDER
	  FROM chart_STYLE		
	  , M_COLORS_MAP map1
	  , M_COLORS_MAP map2
	  WHERE id = style_num
	  and lower(trim(map1.RGB_COLOR_CODE(+))) = lower(trim(BG_COLOR))
	  and lower(trim(map2.RGB_COLOR_CODE(+))) = lower(trim(TEXT_COLOR)) ;			  
	  
	  --SRW.MESSAGE(999, 'values are ' || l_BG_COLOR || l_TEXT_COLOR || l_BOLD || l_ITALIC  || l_UNDERLINE || l_ALIGNMENT  );
	  
	  -- take the style retrieved and do SRW.SET calls
	  	  
	  IF l_BG_COLOR is not null  and LENGTH(l_BG_COLOR) >0 THEN
    	SRW.SET_FOREGROUND_FILL_COLOR(l_BG_COLOR);  
    	srw.set_fill_pattern('solid');
    	--SRW.MESSAGE(999, 'row ' || to_char(:row_number) || ' column number ' || to_char(:column_number) || ', changing BG color to ' || l_BG_COLOR );	  
   
	  END IF;	
	  
		IF l_TEXT_COLOR is not null AND  LENGTH(l_TEXT_COLOR) > 0 THEN	  	
    	SRW.SET_TEXT_COLOR(l_TEXT_COLOR);  
    	--SRW.MESSAGE(999, 'row ' || to_char(:row_number) || ' column number ' || to_char(:column_number) || ' changing color to ' || l_TEXT_COLOR );
	  END IF;		  	
	  
		IF l_BOLD is not null AND  l_BOLD = 1 THEN	  	
    	SRW.SET_FONT_WEIGHT(SRW.BOLD_WEIGHT);
	  END IF;  	
	  
		IF l_ITALIC is not null AND  l_ITALIC = 1 THEN	  	
    	SRW.SET_FONT_STYLE(SRW.ITALIC_STYLE);
	  END IF;	 	
	  
		IF l_UNDERLINE is not null AND  l_UNDERLINE = 1 THEN	  	
    	SRW.SET_FONT_STYLE(SRW.UNDERLINE_STYLE);
	  END IF;	
	  
		IF l_ALIGNMENT is not null AND  LENGTH(l_ALIGNMENT) > 0 THEN	  	
    	SRW.SET_JUSTIFICATION( SRW.CENTER_HJUST );  
		END IF;	
				
		IF l_BORDER is not null and l_BORDER = 1 THEN	  	    	
    	srw.set_foreground_border_color('black');
    	srw.set_border_pattern('solid');
	  END IF;	

	
	END IF;	
	
	-- no style is defined, exit from here and leave everything at its defaults
	return (TRUE);
	
	exception 		
		when no_data_found then
			return (TRUE);
	
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[f_chart_col7formattrigger]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function F_chart_col7FormatTrigger return boolean is

style_num     NUMBER(10)   := 0;
	
	l_BG_COLOR    VARCHAR2(50) := '' ;
	l_TEXT_COLOR  VARCHAR2(50) := '' ;
	l_BOLD        NUMBER(1) := 0;
	l_ITALIC      NUMBER(1) := 0;
	l_UNDERLINE   NUMBER(1) := 0;
	l_ALIGNMENT   VARCHAR2(50) := '';	
	l_BORDER      NUMBER(1) := 0;
	-- this change for every columns
	l_this_column NUMBER(1) := 6;

	l_chart_style NUMBER(38) ;
	l_row_style NUMBER(38) ;
	l_column_style NUMBER(38) ;
	l_cell_style NUMBER(38) ;


begin  
  
  
  
  -- order in precedence (form least significant to most significant) is as following:
  -- chart -> column -> row -> cell
  -- meaning, id cell has a style id defined, use cell style info

  -- JK Jan 28 2009 9(1): 
  -- This snippet *was* cloned from ChartSummary.rdf file, F_Data field, but it got changed today - big time. 
  -- all styles are being retrieved here
    	
  -- JK Jan 28 2009 (2):  add handler for BORDER attribute	

  style_num := 0;    	
  
 select 
  cl3.style_id
into
  l_cell_style	  
from 
  m_chart c3, 
  chart_column co3, 
  chart_row ro3, 
  chart_cell cl3
where 
  c3.id = :basic_chart_id
  and co3.chart_data_id = c3.chart_data_id
	and co3.column_number = l_this_column
  and ro3.chart_data_id = c3.chart_data_id 
  and ro3.row_number = :chart_row_number
  and cl3.chart_data_id = c3.chart_data_id
  and cl3.chart_row_id = ro3.id
	and cl3.chart_column_id = co3.id;
      
  IF l_cell_style is not null AND l_cell_style > 0 THEN
		style_num := l_cell_style;
  END IF;	
  
   
  	
	-- if we have style defined, retrieve the attributes from M_STYLE table
	IF style_num is not null AND  style_num > 0 THEN
				
		
		SELECT
  	 map1.REPORT_COLOR_CODE  as BG_COLOR,
  	 map2.REPORT_COLOR_CODE as TEXT_COLOR,
  	 BOLD        ,
  	 ITALIC      ,
  	 UNDERLINE   ,
  	 ALIGNMENT   ,
  	 BORDER
	  INTO
		 l_BG_COLOR,
		 l_TEXT_COLOR,
		 l_BOLD      ,
		 l_ITALIC     ,
		 l_UNDERLINE  ,
		 l_ALIGNMENT  ,
		 l_BORDER
	  FROM chart_STYLE		
	  , M_COLORS_MAP map1
	  , M_COLORS_MAP map2
	  WHERE id = style_num
	  and lower(trim(map1.RGB_COLOR_CODE(+))) = lower(trim(BG_COLOR))
	  and lower(trim(map2.RGB_COLOR_CODE(+))) = lower(trim(TEXT_COLOR)) ;			  
	  
	  --SRW.MESSAGE(999, 'values are ' || l_BG_COLOR || l_TEXT_COLOR || l_BOLD || l_ITALIC  || l_UNDERLINE || l_ALIGNMENT  );
	  
	  -- take the style retrieved and do SRW.SET calls
	  	  
	  IF l_BG_COLOR is not null  and LENGTH(l_BG_COLOR) >0 THEN
    	SRW.SET_FOREGROUND_FILL_COLOR(l_BG_COLOR);  
    	srw.set_fill_pattern('solid');
    	--SRW.MESSAGE(999, 'row ' || to_char(:row_number) || ' column number ' || to_char(:column_number) || ', changing BG color to ' || l_BG_COLOR );	  
   
	  END IF;	
	  
		IF l_TEXT_COLOR is not null AND  LENGTH(l_TEXT_COLOR) > 0 THEN	  	
    	SRW.SET_TEXT_COLOR(l_TEXT_COLOR);  
    	--SRW.MESSAGE(999, 'row ' || to_char(:row_number) || ' column number ' || to_char(:column_number) || ' changing color to ' || l_TEXT_COLOR );
	  END IF;		  	
	  
		IF l_BOLD is not null AND  l_BOLD = 1 THEN	  	
    	SRW.SET_FONT_WEIGHT(SRW.BOLD_WEIGHT);
	  END IF;  	
	  
		IF l_ITALIC is not null AND  l_ITALIC = 1 THEN	  	
    	SRW.SET_FONT_STYLE(SRW.ITALIC_STYLE);
	  END IF;	 	
	  
		IF l_UNDERLINE is not null AND  l_UNDERLINE = 1 THEN	  	
    	SRW.SET_FONT_STYLE(SRW.UNDERLINE_STYLE);
	  END IF;	
	  
		IF l_ALIGNMENT is not null AND  LENGTH(l_ALIGNMENT) > 0 THEN	  	
    	SRW.SET_JUSTIFICATION( SRW.CENTER_HJUST );  
		END IF;	
				
		IF l_BORDER is not null and l_BORDER = 1 THEN	  	    	
    	srw.set_foreground_border_color('black');
    	srw.set_border_pattern('solid');
	  END IF;	

	
	END IF;	
	
	-- no style is defined, exit from here and leave everything at its defaults
	return (TRUE);
	
	exception 		
		when no_data_found then
			return (TRUE);
	
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[f_chart_col8formattrigger]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function F_chart_col8FormatTrigger return boolean is

style_num     NUMBER(10)   := 0;
	
	l_BG_COLOR    VARCHAR2(50) := '' ;
	l_TEXT_COLOR  VARCHAR2(50) := '' ;
	l_BOLD        NUMBER(1) := 0;
	l_ITALIC      NUMBER(1) := 0;
	l_UNDERLINE   NUMBER(1) := 0;
	l_ALIGNMENT   VARCHAR2(50) := '';	
	l_BORDER      NUMBER(1) := 0;
	-- this change for every columns
	l_this_column NUMBER(1) := 7;

	l_chart_style NUMBER(38) ;
	l_row_style NUMBER(38) ;
	l_column_style NUMBER(38) ;
	l_cell_style NUMBER(38) ;


begin  
  
  
  
  -- order in precedence (form least significant to most significant) is as following:
  -- chart -> column -> row -> cell
  -- meaning, id cell has a style id defined, use cell style info

  -- JK Jan 28 2009 9(1): 
  -- This snippet *was* cloned from ChartSummary.rdf file, F_Data field, but it got changed today - big time. 
  -- all styles are being retrieved here
    	
  -- JK Jan 28 2009 (2):  add handler for BORDER attribute	

  style_num := 0;    	
  
 select 
  cl3.style_id
into
  l_cell_style	  
from 
  m_chart c3, 
  chart_column co3, 
  chart_row ro3, 
  chart_cell cl3
where 
  c3.id = :basic_chart_id
  and co3.chart_data_id = c3.chart_data_id
	and co3.column_number = l_this_column
  and ro3.chart_data_id = c3.chart_data_id 
  and ro3.row_number = :chart_row_number
  and cl3.chart_data_id = c3.chart_data_id
  and cl3.chart_row_id = ro3.id
	and cl3.chart_column_id = co3.id;
      

  IF l_cell_style is not null AND l_cell_style > 0 THEN
		style_num := l_cell_style;
  END IF;	
  
   
  	
	-- if we have style defined, retrieve the attributes from M_STYLE table
	IF style_num is not null AND  style_num > 0 THEN
				
		
		SELECT
  	 map1.REPORT_COLOR_CODE  as BG_COLOR,
  	 map2.REPORT_COLOR_CODE as TEXT_COLOR,
  	 BOLD        ,
  	 ITALIC      ,
  	 UNDERLINE   ,
  	 ALIGNMENT   ,
  	 BORDER
	  INTO
		 l_BG_COLOR,
		 l_TEXT_COLOR,
		 l_BOLD      ,
		 l_ITALIC     ,
		 l_UNDERLINE  ,
		 l_ALIGNMENT  ,
		 l_BORDER
	  FROM chart_STYLE		
	  , M_COLORS_MAP map1
	  , M_COLORS_MAP map2
	  WHERE id = style_num
	  and lower(trim(map1.RGB_COLOR_CODE(+))) = lower(trim(BG_COLOR))
	  and lower(trim(map2.RGB_COLOR_CODE(+))) = lower(trim(TEXT_COLOR)) ;			  
	  
	  --SRW.MESSAGE(999, 'values are ' || l_BG_COLOR || l_TEXT_COLOR || l_BOLD || l_ITALIC  || l_UNDERLINE || l_ALIGNMENT  );
	  
	  -- take the style retrieved and do SRW.SET calls
	  	  
	  IF l_BG_COLOR is not null  and LENGTH(l_BG_COLOR) >0 THEN
    	SRW.SET_FOREGROUND_FILL_COLOR(l_BG_COLOR);  
    	srw.set_fill_pattern('solid');
    	--SRW.MESSAGE(999, 'row ' || to_char(:row_number) || ' column number ' || to_char(:column_number) || ', changing BG color to ' || l_BG_COLOR );	  
   
	  END IF;	
	  
		IF l_TEXT_COLOR is not null AND  LENGTH(l_TEXT_COLOR) > 0 THEN	  	
    	SRW.SET_TEXT_COLOR(l_TEXT_COLOR);  
    	--SRW.MESSAGE(999, 'row ' || to_char(:row_number) || ' column number ' || to_char(:column_number) || ' changing color to ' || l_TEXT_COLOR );
	  END IF;		  	
	  
		IF l_BOLD is not null AND  l_BOLD = 1 THEN	  	
    	SRW.SET_FONT_WEIGHT(SRW.BOLD_WEIGHT);
	  END IF;  	
	  
		IF l_ITALIC is not null AND  l_ITALIC = 1 THEN	  	
    	SRW.SET_FONT_STYLE(SRW.ITALIC_STYLE);
	  END IF;	 	
	  
		IF l_UNDERLINE is not null AND  l_UNDERLINE = 1 THEN	  	
    	SRW.SET_FONT_STYLE(SRW.UNDERLINE_STYLE);
	  END IF;	
	  
		IF l_ALIGNMENT is not null AND  LENGTH(l_ALIGNMENT) > 0 THEN	  	
    	SRW.SET_JUSTIFICATION( SRW.CENTER_HJUST );  
		END IF;	
				
		IF l_BORDER is not null and l_BORDER = 1 THEN	  	    	
    	srw.set_foreground_border_color('black');
    	srw.set_border_pattern('solid');
	  END IF;	

	
	END IF;
	
	-- no style is defined, exit from here and leave everything at its defaults
	return (TRUE);
	
	exception 		
		when no_data_found then
			return (TRUE);
	
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[b_no_chart_data_msg1formattrig]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function B_no_chart_data_msg1FormatTrig return boolean is
begin

  -- Automatically Generated from Report Builder.
  if (:CS_Chart_Count > '0')
  then
    return (FALSE);
  end if;

  return (TRUE);
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[b_legend_colour_box1formattrig]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function B_LEGEND_COLOUR_BOX1FormatTrig return boolean is

	s_color varchar2(12) := 'r25g50b100';

begin
    
-- this is the order - make sure it's on sync with graph definiton (XML )
--red  		#ff0000
--blue 		#0000ff
--black		#000000
--green		#00ff00
--yellow  	#ffff00
--magenta 	#ff00ff
--cyan    	#00ffff
--gray    	#808080
--darkred 	#800000
--darkblue 	#000080

--darkgreen 
--darkyellow 
--darkmagenta
--darkcyan 
--darkgray 


-- used to be red & blue
if (:measurements_set_name = 'Actuals') then
    s_color := 'r100g0b0';
end if;    

if (:measurements_set_name = 'Targets High Values') then
    s_color := 'r50g75b100';
end if;


  srw.set_foreground_fill_color(s_color);
  srw.set_fill_pattern('solid');

  return (TRUE);
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[r_measurements_set_name1format]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function R_MEASUREMENTS_SET_NAME1Format return boolean is
begin

  -- Automatically Generated from Report Builder.
   if (:CS_TYPE_OF_GRAPH_IMAGE != 'System Generated'
  	  or 
  	  (:CS_Count_Graph_Table_Rows = 0))
  then
    return (FALSE);
  end if;
  
  return (TRUE);
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[m_21formattrigger]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function M_21FormatTrigger return boolean is
begin
  if (:CS_Measure_Count < '1')
  then
    return (FALSE);
  end if;

  return (TRUE);
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[m_17formattrigger]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function M_17FormatTrigger return boolean is
begin

  -- Automatically Generated from Report Builder.
  if (:CS_Chart_Count < 1)
  then
    return (FALSE);
  end if;

  return (TRUE);
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[m_chart_data1formattrigger]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function M_chart_data1FormatTrigger return boolean is
begin
  
  return (TRUE);
end;]]></Property>
			</Group>
			<Group Name="Field:">
				<Property Name="Field:"><![CDATA[r_chart_built_manually1formatt]]></Property>
				<Property Name="Type:"><![CDATA[Function Body]]></Property>
				<Property Name="Formula:"><![CDATA[function R_Chart_Built_Manually1FormatT return boolean is
begin
  
  return (TRUE);
end;]]></Property>
			</Group>
		</Group>
		<Group Name="Groups">
			<Group Name="Group:">
				<Property Name="Group:"><![CDATA[main Section]]></Property>
				<Group Name="Body">
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_G_TITLE_GRPFR]]></Property>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_3]]></Property>
								<Property Name="Text:"><![CDATA[*  *  *    e n d   o f   r e p o r t   *  *  *]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_15]]></Property>
						<Group Name="Fields">
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_TARGETS]]></Property>
								<Property Name="Data Source:"><![CDATA[target1]]></Property>
							</Group>
						</Group>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_OBJECTIVES1]]></Property>
								<Property Name="Text:"><![CDATA[Targets:]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_STARTEGY_TITLE]]></Property>
						<Group Name="Fields">
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_strategy]]></Property>
								<Property Name="Data Source:"><![CDATA[strategy_title]]></Property>
							</Group>
						</Group>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_strategy]]></Property>
								<Property Name="Text:"><![CDATA[Title]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_2]]></Property>
						<Group Name="Fields">
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_BUSINESS_NUMBER]]></Property>
								<Property Name="Data Source:"><![CDATA[BUSINESS_NUMBER]]></Property>
							</Group>
						</Group>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_BUSINESS_NUMBER]]></Property>
								<Property Name="Text:"><![CDATA[Business Number]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_3]]></Property>
						<Group Name="Fields">
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_strat_desc]]></Property>
								<Property Name="Data Source:"><![CDATA[strat_desc]]></Property>
							</Group>
						</Group>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_strat_desc]]></Property>
								<Property Name="Text:"><![CDATA[Description]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_4]]></Property>
						<Group Name="Fields">
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_status]]></Property>
								<Property Name="Data Source:"><![CDATA[strat_status]]></Property>
							</Group>
						</Group>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_title1]]></Property>
								<Property Name="Text:"><![CDATA[Strategy Status]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_5]]></Property>
						<Group Name="Fields">
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_strategy_rs]]></Property>
								<Property Name="Data Source:"><![CDATA[strat_rs]]></Property>
							</Group>
						</Group>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_2]]></Property>
								<Property Name="Text:"><![CDATA[Reporting Status]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_8]]></Property>
						<Group Name="Fields">
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_Strategy_RS_Comments]]></Property>
								<Property Name="Data Source:"><![CDATA[strat_rs_comments]]></Property>
							</Group>
						</Group>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_9]]></Property>
								<Property Name="Text:"><![CDATA[Status Comments]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_G_Objectives_GRPFR1]]></Property>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_OBJECTIVES]]></Property>
								<Property Name="Text:"><![CDATA[Objectives]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_G_UNIT_ID_GRPFR]]></Property>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_UNIT]]></Property>
								<Property Name="Text:"><![CDATA[Belongs To:]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_RELATED_FILES]]></Property>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_RELATED_FILES]]></Property>
								<Property Name="Text:"><![CDATA[Related Files:]]></Property>
							</Group>
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_10]]></Property>
								<Property Name="Text:"><![CDATA[File Status]]></Property>
							</Group>
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_12]]></Property>
								<Property Name="Text:"><![CDATA[File Number]]></Property>
							</Group>
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_13]]></Property>
								<Property Name="Text:"><![CDATA[File Name]]></Property>
							</Group>
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_19]]></Property>
								<Property Name="Text:"><![CDATA[Organization Unit]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_REL_FILES_NAME_NUMBER_STATUS]]></Property>
						<Group Name="Fields">
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_record_status]]></Property>
								<Property Name="Data Source:"><![CDATA[file_status]]></Property>
							</Group>
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_FILE_NUMBER]]></Property>
								<Property Name="Data Source:"><![CDATA[file_number]]></Property>
							</Group>
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_FILE_NAME]]></Property>
								<Property Name="Data Source:"><![CDATA[file_name]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_1]]></Property>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_18]]></Property>
								<Property Name="Text:"><![CDATA[File Reporting:]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_REL_FILES_REPORTING_DATA]]></Property>
						<Group Name="Fields">
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_FILE_REPORTING_STATUS]]></Property>
								<Property Name="Data Source:"><![CDATA[file_reporting_status]]></Property>
							</Group>
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_REP_STATUS_COMMENT]]></Property>
								<Property Name="Data Source:"><![CDATA[file_reporting_status_comment]]></Property>
							</Group>
						</Group>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_36]]></Property>
								<Property Name="Text:"><![CDATA[Reporting Status]]></Property>
							</Group>
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_37]]></Property>
								<Property Name="Text:"><![CDATA[Reporting Status Comment]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_CONTACTS]]></Property>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_CONTACTS_SECTION_TITLE]]></Property>
								<Property Name="Text:"><![CDATA[Contacts:]]></Property>
							</Group>
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_cont_col3]]></Property>
								<Property Name="Text:"><![CDATA[Contact Team]]></Property>
							</Group>
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_cont_col2]]></Property>
								<Property Name="Text:"><![CDATA[Contact Role]]></Property>
							</Group>
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_cont_col1]]></Property>
								<Property Name="Text:"><![CDATA[Contact Name]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_CONTACT_TEAMS]]></Property>
						<Group Name="Fields">
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_Contact Ministry]]></Property>
								<Property Name="Data Source:"><![CDATA[Contact_Portf_Ministry]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_6]]></Property>
						<Group Name="Fields">
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_doc_creator]]></Property>
								<Property Name="Data Source:"><![CDATA[doc_creator]]></Property>
							</Group>
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_co_filename]]></Property>
								<Property Name="Data Source:"><![CDATA[co_filename]]></Property>
							</Group>
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_doc_date]]></Property>
								<Property Name="Data Source:"><![CDATA[doc_date]]></Property>
							</Group>
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_doc_pkg_templ_name]]></Property>
								<Property Name="Data Source:"><![CDATA[doc_pkg_templ_name]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_DOC_TITLE_WRAPPER]]></Property>
						<Group Name="Fields">
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_doc_docname]]></Property>
								<Property Name="Data Source:"><![CDATA[co_docname]]></Property>
							</Group>
						</Group>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_DOC_TITLE]]></Property>
								<Property Name="Text:"><![CDATA[Title:]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_DOC_DESCRIPTION_WRAPPER]]></Property>
						<Group Name="Fields">
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_CF_doc_desc_decrypt]]></Property>
								<Property Name="Data Source:"><![CDATA[CF_doc_desc_decrypt]]></Property>
							</Group>
						</Group>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_DOC_DESCRIPTION]]></Property>
								<Property Name="Text:"><![CDATA[Description:]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_22]]></Property>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_METRICS_SECTION_TITLE]]></Property>
								<Property Name="Text:"><![CDATA[Metrics:]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_21]]></Property>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_RELATED_MEASURES]]></Property>
								<Property Name="Text:"><![CDATA[Performance Measures:]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_16]]></Property>
						<Group Name="Fields">
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_meas_title]]></Property>
								<Property Name="Data Source:"><![CDATA[meas_title]]></Property>
							</Group>
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_meas_type]]></Property>
								<Property Name="Data Source:"><![CDATA[meas_type]]></Property>
							</Group>
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_measure_number]]></Property>
								<Property Name="Data Source:"><![CDATA[measure_number]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_24]]></Property>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_NO_METRICS_YET_MSG]]></Property>
								<Property Name="Text:"><![CDATA[No measurement data yet.]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_GRAPH_DATA_TABULAR_VIEW]]></Property>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_5]]></Property>
								<Property Name="Text:"><![CDATA[Entered Data Date]]></Property>
							</Group>
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_14]]></Property>
								<Property Name="Text:"><![CDATA[Target Value]]></Property>
							</Group>
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_20]]></Property>
								<Property Name="Text:"><![CDATA[Actual Value]]></Property>
							</Group>
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_21]]></Property>
								<Property Name="Text:"><![CDATA[Total To Date]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_MEASURE_HEADERS]]></Property>
						<Group Name="Fields">
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_Measure_Title]]></Property>
								<Property Name="Data Source:"><![CDATA[measure_type]]></Property>
							</Group>
						</Group>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_meas_type1]]></Property>
								<Property Name="Text:"><![CDATA[Type]]></Property>
							</Group>
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_measure_unit1]]></Property>
								<Property Name="Text:"><![CDATA[Measure Number]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_13]]></Property>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_RELATED_CHARTS]]></Property>
								<Property Name="Text:"><![CDATA[Charts:]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_12]]></Property>
						<Group Name="Fields">
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_Chart_Description1]]></Property>
								<Property Name="Data Source:"><![CDATA[chart_description]]></Property>
							</Group>
						</Group>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_32]]></Property>
								<Property Name="Text:"><![CDATA[Description]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_10]]></Property>
						<Group Name="Fields">
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_Chart_Data_Source1]]></Property>
								<Property Name="Data Source:"><![CDATA[chart_data_source]]></Property>
							</Group>
						</Group>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_29]]></Property>
								<Property Name="Text:"><![CDATA[Data Source]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_9]]></Property>
						<Group Name="Fields">
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_Chart_Rep_Status_Comment1]]></Property>
								<Property Name="Data Source:"><![CDATA[chart_rep_status_comment]]></Property>
							</Group>
						</Group>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_27]]></Property>
								<Property Name="Text:"><![CDATA[Status Comment]]></Property>
							</Group>
						</Group>
					</Group>
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Frame M_17]]></Property>
						<Group Name="Fields">
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_Chart_Header1]]></Property>
								<Property Name="Data Source:"><![CDATA[chart_header]]></Property>
							</Group>
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_Chart_Footer1]]></Property>
								<Property Name="Data Source:"><![CDATA[chart_footer]]></Property>
							</Group>
						</Group>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_EMPTY_FIELD]]></Property>
								<Property Name="Text:"><![CDATA[.....]]></Property>
							</Group>
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_no_chart_data_msg1]]></Property>
								<Property Name="Text:"><![CDATA[No chart data]]></Property>
							</Group>
						</Group>
					</Group>
				</Group>
				<Group Name="Margin">
					<Group Name="Section:">
						<Property Name="Section:"><![CDATA[Margin]]></Property>
						<Group Name="Fields">
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_MINISTRY_NAME]]></Property>
								<Property Name="Data Source:"><![CDATA[CF_Ministry_Name]]></Property>
							</Group>
							<Group Name="Field:">
								<Property Name="Field:"><![CDATA[F_datetime]]></Property>
								<Property Name="Data Source:"><![CDATA[CurrentDate]]></Property>
							</Group>
						</Group>
						<Group Name="Text Fields">
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_OR$BODY_SECTION1]]></Property>
								<Property Name="Text:"><![CDATA[Strategy Summary Report]]></Property>
							</Group>
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_15]]></Property>
								<Property Name="Text:"><![CDATA[Confidential]]></Property>
							</Group>
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_16]]></Property>
								<Property Name="Text:"><![CDATA[EVista Report (v&CP_VERSION) ]]></Property>
							</Group>
							<Group Name="Text Field:">
								<Property Name="Text Field:"><![CDATA[B_17]]></Property>
								<Property Name="Text:"><![CDATA[Page &<PageNumber> of &<TotalPages>]]></Property>
							</Group>
						</Group>
					</Group>
				</Group>
			</Group>
		</Group>
		<Group Name="Web Sources">
			<Property Name="Source:"><![CDATA[<%@ taglib uri="/WEB-INF/lib/reports_tld.jar" prefix="rw" %> 
<%@ page language="java" import="java.io.*" errorPage="/rwerror.jsp" session="false" %>
<%@ page contentType="text/html;charset=ISO-8859-1" %>
<!--
<rw:report id="report"> 
<rw:objects id="objects">
</rw:objects>
-->

<html>

<head>
<meta name="GENERATOR" content="Oracle 9i Reports Developer"/>
<title> Your Title </title>



</head>


<body>

<!-- Data Area Generated by Reports Developer -->
<rw:dataArea id="MGTITLEGRPFR9">
<rw:foreach id="RGTITLE91" src="G_TITLE">
<!-- Start GetGroupHeader/n --> <table>
 <caption>  <br>Title <rw:field id="F_strategy" src="strategy" breakLevel="RGTITLE91" breakValue="&nbsp;"> F_strategy </rw:field><br>
Business Number <rw:field id="F_BUSINESS_NUMBER" src="BUSINESS_NUMBER" breakLevel="RGTITLE91" breakValue="&nbsp;"> F_BUSINESS_NUMBER </rw:field><br>
Description <rw:field id="F_strat_desc" src="strat_desc" breakLevel="RGTITLE91" breakValue="&nbsp;"> F_strat_desc </rw:field><br>
Title <rw:field id="F_title" src="title" breakLevel="RGTITLE91" breakValue="&nbsp;"> F_title </rw:field><br>
 </caption>
<!-- End GetGroupHeader/n -->   <tr>
    <td valign="top">
    <table summary="">
     <!-- Header -->
     <thead>
      <tr>
       <th <rw:id id="HBACRONYM9" asArray="no"/>> Acronym </th>
       <th <rw:id id="HBunitname9" asArray="no"/>> Dn </th>
      </tr>
     </thead>
     <!-- Body -->
     <tbody>
      <rw:foreach id="RGUNITID91" src="G_UNIT_ID">
       <tr>
        <td <rw:headers id="HFACRONYM9" src="HBACRONYM9"/>><rw:field id="FACRONYM9" src="ACRONYM" nullValue="&nbsp;"> F_ACRONYM </rw:field></td>
        <td <rw:headers id="HFunitname9" src="HBunitname9"/>><rw:field id="Funitname9" src="unit_name" nullValue="&nbsp;"> F_unit_name </rw:field></td>
       </tr>
      </rw:foreach>
     </tbody>
     <tr>
     </tr>
    </table>
    <table summary="">
     <!-- Header -->
     <thead>
      <tr>
       <th <rw:id id="HBstobjective9" asArray="no"/>> St Objective </th>
      </tr>
     </thead>
     <!-- Body -->
     <tbody>
      <rw:foreach id="RGID191" src="G_ID1">
       <tr>
        <td <rw:headers id="HFstobjective9" src="HBstobjective9"/>><rw:field id="Fstobjective9" src="st_objective" nullValue="&nbsp;"> F_st_objective </rw:field></td>
       </tr>
      </rw:foreach>
     </tbody>
     <tr>
     </tr>
    </table>
   </td>
  </tr>
 </table>
</rw:foreach>
<table summary="">
</table>
</rw:dataArea> <!-- id="MGTITLEGRPFR9" -->
<!-- End of Data Area Generated by Reports Developer -->




</body>
</html>

<!--
</rw:report> 
-->
]]></Property>
		</Group>
	</Group>
</Report>