XMLP: Important Tags

 XML Publisher Important Tags:

<?for-each:current-group()?>

<?end for-each-group?>

-----------------------------------------------------------------------------------------------------------------------------

<?for-each:DISTRICTPART2?>

<?end for-each?>

-----------------------------------------------------------------------------------------------------------------------------

<?for-each-group@section:HEADER;./EMPLID?>

<?end for-each-group?>

<?for-each:COUNT[CRSE_ATTR_VALUE = '5' and RESIDENT = 'Y']?>

<?end for-each?>

-----------------------------------------------------------------------------------------------------------------------------

Substring 

<?xdofx:substr(DESCR,1,4)?>

<?xdofx:substr(STRM,2,2)?>

<?xdofx:if substr(STRM,4,1) ='1' then 'Spring' end if?>

<?xdofx:if substr(STRM,4,1) ='5' then 'Summer' end if?>

<?xdofx:if substr(STRM,4,1) ='8' then 'Fall' end if?>

<?xdofx:if JPM_CAT_TYPE ='TEMP_CERT' then 'TEMPORARY' end if?>

<?YEAR[not(.=preceding::YEAR)]?>

-----------------------------------------------------------------------------------------------------------------------------

<?xdofx:ifSEX = 'M'  then 'Male' end if?>

<?xdofx:ifSEX = 'F'  then 'Female' end if?>

<?xdofx:ifSEX = 'U'  then 'Unknown' end if?>

-----------------------------------------------------------------------------------------------------------------------------

<?for-each:SUMMER1[position()<2]?>

-----------------------------------------------------------------------------------------------------------------------------

<?for-each:DISTRICT[CRSE_ATTR_VALUE = '5' and RESIDENT = 'Y']?>

<?end for-each?>

<?for-each:TERMS[SEQNO = '1']?>

<?end for-each?>

-----------------------------------------------------------------------------------------------------------------------------

<?for-each:current-group()?>

<?end for-each-group?>

-----------------------------------------------------------------------------------------------------------------------------

<?for-each-group@section:HEADER;./EMPLID?>

<?end for-each-group?>

-----------------------------------------------------------------------------------------------------------------------------

<?xdofx:substr(TERM,2,3)?>

<?YEAR[not(.=preceding::YEAR)]?>

-----------------------------------------------------------------------------------------------------------------------------

<?xdofx:if STATE != ' '  then STATE || "/" end if?>

<?xdofx:if STATE <> ' '  then '/' end if?>

<?xdofx:if STATE <> ' '  then '/' end if?>

<?xdofx:if STATE = ' '  then '' end if?>

-----------------------------------------------------------------------------------------------------------------------------

<?for-each:SUMMER1[position()<2]?>

-----------------------------------------------------------------------------------------------------------------------------

To get the rows as columns in bi publisher repot.

<?for-each@inlines:TERMS?>

<?end for-each?>

-----------------------------------------------------------------------------------------------------------------------------

<?for-each:G_SSR_TSRSLT_STAT?>

<?if:PRINT_AREA_CODE='ET' and SSR_ROWTYPE='STAT' AND STATUS = 'N'?>

<?if:STATUS = 'N'?>   <?end if?>

-----------------------------------------------------------------------------------------------------------------------------

 <?xdofx:if substr(ACAD_PLAN,1,1) = 'C'  then 'Los Angeles City College' end if?>

 <?xdofx:if substr(ACAD_PLAN,1,1) = 'H'  then 'Los Angeles Harbor College' end if?>

 <?xdofx:if substr(ACAD_PLAN,1,1) = 'M'  then 'Los Angeles Mission College' end if?>

 <?xdofx:if substr(ACAD_PLAN,1,1) = 'P'  then 'Pierce College' end if?>

 <?xdofx:if substr(ACAD_PLAN,1,1) = 'S'  then 'Los Angeles Southwest College' end if?>

 <?xdofx:if substr(ACAD_PLAN,1,1) = 'V'  then 'Los Angeles Valley College' end if?>

 <?xdofx:if substr(ACAD_PLAN,1,1) = 'W'  then 'West Los Angeles College' end if?>

 <?xdofx:if substr(ACAD_PLAN,1,1) = 'T'  then 'LA Trade-Technical Colleg' end if?>

 <?xdofx:if substr(ACAD_PLAN,1,1) = 'E'  then 'East Los Angeles College' end if?>;

-----------------------------------------------------------------------------------------------------------------------------

If-Else Condition:

<?if:DIRECT_TOTAL = 0?>

<?INTEREST = 0?>

<?end if?>

<?if:DIRECT_TOTAL != 0?>

<?INTEREST?>

<?end if?>

-----------------------------------------------------------------------------------------------------------------------------

Removing duplicates for lift side header:


<?fld_DESCR[not(.=preceding::fld_DESCR)]?>


<?fld_CF_ATTRIB_VALUE[not(.=preceding::fld_CF_ATTRIB_VALUE)]?>

<?fld_DESCR[not(.=preceding::fld_DESCR)]?>


-----------------------------------------------------------------------------------------------------------------------------

Current Date and time in BI Template:

<?xdoxslt:sysdate('DD-MON-YYYY HH24:MI')?>

-----------------------------------------------------------------------------------------------------------------------------

length <?xdofx:length(char)?> The "length" function returns the length of char.

LENGTH calculates length using characters as defined by the input character set.

-----------------------------------------------------------------------------------------------------------------------------

Changing Numbers into workds in bi template

<?xdofx:to_check_number(DESCR100_2, 'JPY', 'CASE_UPPER')?>

<?DESCR100_3?>

<?xdofx:to_check_number(DESCR100_4, 'JPY', 'CASE_UPPER')?>

-----------------------------------------------------------------------------------------------------------------------------

Getting the distinct employees from the HEADER

<?for-each-group:HEADER;./EMPLID?>

-----------------------------------------------------------------------------------------------------------------------------

<?xdoxslt:get_month(COMPLETED_DT,$_XDOLOCALE)?>

<?for-each-group:current-group();./DESCRIPTION?>

<?for-each-group@section:HEADER;./EMPLID?>

<?for-each-group:current-group();./EMPLID?>

<?for-each-group@section:HEADER;./EMPLID?>

<?for-each-group:HEADER;./EMPLID?>

-----------------------------------------------------------------------------------------------------------------------------

, ROW_NUMBER() OVER(PARTITION BY A.EMPLID 

  ORDER BY A.EMPLID 

  ,A.STRM DESC) 

<?sum(name_off_field)?>

<?xdofx:if sum(name_off_field) = '1'?>

-----------------------------------------------------------------------------------------------------------------------------

<?split-by-page-break:?>

-----------------------------------------------------------------------------------------------------------------------------

Change the text color based on the condition

<?if:CRSE_GRADE_OFF ='C-' or CRSE_GRADE_OFF='D' or CRSE_GRADE_OFF='F'?><?attribute@incontext:color;'red'?><?end if?><?SUBJECT?>

-----------------------------------------------------------------------------------------------------------------------------

Formatting Numbers,Date.

https://docs.oracle.com/middleware/12211/bip/BIPRD/GUID-7BD3C665-851A-43FE-BA2D-7501390D95AC.htm#BIPRD2554

-----------------------------------------------------------------------------------------------------------------------------

Date field in a required format.

<?format-date:BIRTHDATE;'DD MMM YYYY'?>

<?format-date:hiredate;'YYYY-MM-DD'?>

-----------------------------------------------------------------------------------------------------------------------------

System date and time to print on the template

Customized ---->     Date:<?xdoxslt:sysdate('DD/MM/YYYY')?>

                     Date:<?xdoxslt:sysdate('DD:MM:YYYY  HH:MI:SS')?>     

Standard ------>     Date:<?xdoxslt:sysdate()?>

-----------------------------------------------------------------------------------------------------------------------------

For each alternate row, the background color attribute is set to gray for the row:

<?if@row:position() mod 2=0?> <xsl:attribute name="background-color" xdofo:ctx="incontext">lightgray</xsl:attribute><?end if?>

-----------------------------------------------------------------------------------------------------------------------------

If-Else Condition: For APS Report.

<?xdofx:if SCORE =0 then 'No Show' else if SCORE ='' then 'No Show' else if SCORE =' ' then 'No Show' else SCORE end if?>

<?xdofx:if STATE =' ' then ' ' else if STATE ='' then ' ' else '/'end if?>

<?xdofx:ifAFA_ATHLETIC = 'Y'  then 'Yes' end if?>

<?xdofx:if AFA_ATHLETIC = 'Y'  then 'Yes' else '-'end if?>

-----------------------------------------------------------------------------------------------------------------------------

<?choose:?>

 <?when:count(TRX_NUMBER) > 0?>

     Invoice Table

 <?end when?>

 <?otherwise:?>

     No Data Found

 <?end otherwise?>

<?end choose?>


-----------------------------------------------------------------------------------------------------------------------------

<?for-each@section:G_CUSTOMER?>

<?choose:?>

<?when:CUSTOMER_NAME!=?> or <?when:G_CUSTOMER>

Customer Header Info


    Invoice Table


<?end when?>

<?otherwise?>

No Data Found

<?end otherwise?>

<?end choose?>

-----------------------------------------------------------------------------------------------------------------------------

<?choose:?><?when:ROW/INVOICE_NO!=''?>

<?for-each-group@section:ROW;./INVOICE_NO?>

..............body................

<?end for-each?>

<?end when?><?otherwise:?>

NO_DATA_FOUND

<?end otherwise?><?end choose?>

-----------------------------------------------------------------------------------------------------------------------------

http://alioracleapps.blogspot.com/2017/01/usefull-xml-tags-in-bi-publisher.html

-----------------------------------------------------------------------------------------------------------------------------

The below code worked for APS Report.

<?if:count(SPRING1)=0?>

No Data

<?end if?>

-----------------------------------------------------------------------------------------------------------------------------

<?for-each:SUMMER?>

<?end for-each?>

-----------------------------------------------------------------------------------------------------------------------------

<?xdofx:if SCORE =0 then 'No Show' else if SCORE ='' then 'No Show' else if SCORE =' ' then 'No Show' else SCORE end if?>

-----------------------------------------------------------------------------------------------------------------------------

<?sum(current-group()//fld_PERCENTAGE)?>

<?PERCENTAGE?>

<?sum(current-group()//PERCENTAGE)?>

<?sum(.//PERCENTAGE)?>

-----------------------------------------------------------------------------------------------------------------------------

<?if:count(STDNTTERMS[SEQNO = '14'])!=0?>

<?if:XMLfield=value1 or XMLfield=value2?> display value <?end if?>

-----------------------------------------------------------------------------------------------------------------------------

XSL function to convert number to word Below code is used to convert Word from number in XSL.

Sample Code: <?xdoxslt:toWordsAmt(12345.98)?>

Output:  “Twelve Thousand Three Hundred Fourty Five and paise Ninety Eight”.

The code can be used in xml publisher document to convert number to word.

-----------------------------------------------------------------------------------------------------------------------------

Removing duplicates for lift side header

<?fld_DESCR[not(.=preceding::fld_DESCR)]?>

<?fld_CF_ATTRIB_VALUE[not(.=preceding::fld_CF_ATTRIB_VALUE)]?>

<?fld_DESCR[not(.=preceding::fld_DESCR)]?>

-----------------------------------------------------------------------------------------------------------------------------

<?for-each:current-group()?>

<?end for-each-group?>

-----------------------------------------------------------------------------------------------------------------------------

<?for-each:DISTRICTPART2?>

<?end for-each?>

-----------------------------------------------------------------------------------------------------------------------------

<?for-each-group@section:HEADER;./EMPLID?>

<?end for-each-group?>

<?for-each:COUNT[CRSE_ATTR_VALUE = '5' and RESIDENT = 'Y']?>

<?end for-each?>

-----------------------------------------------------------------------------------------------------------------------------<?xdofx:substr(DESCR,1,4)?>

<?xdofx:substr(STRM,2,2)?>

<?xdofx:if substr(STRM,4,1) ='1' then 'Spring' end if?>

<?xdofx:if substr(STRM,4,1) ='5' then 'Summer' end if?>

<?xdofx:if substr(STRM,4,1) ='8' then 'Fall' end if?>

<?xdofx:if JPM_CAT_TYPE ='TEMP_CERT' then 'TEMPORARY' end if?>

<?YEAR[not(.=preceding::YEAR)]?>

-----------------------------------------------------------------------------------------------------------------------------

<?xdofx:ifSEX = 'M'  then 'Male' end if?>

<?xdofx:ifSEX = 'F'  then 'Female' end if?>

<?xdofx:ifSEX = 'U'  then 'Unknown' end if?>

-----------------------------------------------------------------------------------------------------------------------------

<?for-each:SUMMER1[position()<2]?>

-----------------------------------------------------------------------------------------------------------------------------

<?for-each:DISTRICT[CRSE_ATTR_VALUE = '5' and RESIDENT = 'Y']?>

<?end for-each?>

<?for-each:TERMS[SEQNO = '1']?>

-----------------------------------------------------------------------------------------------------------------------------

<?for-each:current-group()?>

<?end for-each-group?>

----------------------------------------------------------------------------------------------------------------------------

<?for-each:DISTRICTPART2?>

<?end for-each?>

----------------------------------------------------------------------------------------------------------------------------

<?for-each-group@section:HEADER;./EMPLID?>

<?end for-each-group?>

<?for-each:COUNT[CRSE_ATTR_VALUE = '5' and RESIDENT = 'Y']?>

<?end for-each?>

-----------------------------------------------------------------------------------------------------------------------------

<?xdofx:substr(TERM,2,3)?>

<?YEAR[not(.=preceding::YEAR)]?>

-----------------------------------------------------------------------------------------------------------------------------

<?xdofx:if SEX = 'M'  then 'Male' end if?>

<?xdofx:if SEX = 'F'  then 'Female' end if?>

<?xdofx:if SEX = 'U'  then 'Unknown' end if?>

-----------------------------------------------------------------------------------------------------------------------------

<?for-each:SUMMER1[position()<2]?>

-----------------------------------------------------------------------------------------------------------------------------

To get the rows as columns in bi publisher repot.

<?for-each@inlines:TERMS?>

<?end for-each?>

-----------------------------------------------------------------------------------------------------------------------------

<?for-each:G_SSR_TSRSLT_STAT?>

<?if:PRINT_AREA_CODE='ET' and SSR_ROWTYPE='STAT' AND STATUS = 'N'?>

<?if:STATUS = 'N'?>   <?end if?>

-----------------------------------------------------------------------------------------------------------------------------

 <?xdofx:if substr(ACAD_PLAN,1,1) = 'C'  then 'Los Angeles City College' end if?>

 <?xdofx:if substr(ACAD_PLAN,1,1) = 'H'  then 'Los Angeles Harbor College' end if?>

 <?xdofx:if substr(ACAD_PLAN,1,1) = 'M'  then 'Los Angeles Mission College' end if?>

 <?xdofx:if substr(ACAD_PLAN,1,1) = 'P'  then 'Pierce College' end if?>

 <?xdofx:if substr(ACAD_PLAN,1,1) = 'S'  then 'Los Angeles Southwest College' end if?>

 <?xdofx:if substr(ACAD_PLAN,1,1) = 'V'  then 'Los Angeles Valley College' end if?>

 <?xdofx:if substr(ACAD_PLAN,1,1) = 'W'  then 'West Los Angeles College' end if?>

 <?xdofx:if substr(ACAD_PLAN,1,1) = 'T'  then 'LA Trade-Technical Colleg' end if?>

 <?xdofx:if substr(ACAD_PLAN,1,1) = 'E'  then 'East Los Angeles College' end if?>;


-----------------------------------------------------------------------------------------------------------------------------If-Else Condition:

<?if:DIRECT_TOTAL = 0?>

<?INTEREST = 0?>

<?end if?>

<?if:DIRECT_TOTAL != 0?>

<?INTEREST?>

<?end if?>

-----------------------------------------------------------------------------------------------------------------------------Removing duplicates for lift side header:

<?fld_DESCR[not(.=preceding::fld_DESCR)]?>

<?fld_CF_ATTRIB_VALUE[not(.=preceding::fld_CF_ATTRIB_VALUE)]?>

<?fld_DESCR[not(.=preceding::fld_DESCR)]?>

-----------------------------------------------------------------------------------------------------------------------------Current Date and time in BI Template:

<?xdoxslt:sysdate(‘DD-MON-YYYY HH24:MI’)?>

-----------------------------------------------------------------------------------------------------------------------------Length <?xdofx:length(char)?> The "length" function returns the length of char.

LENGTH calculates length using characters as defined by the input character set.

-----------------------------------------------------------------------------------------------------------------------------

Numbers into workds in bi template

<?xdofx:to_check_number(DESCR100_2, 'JPY', 'CASE_UPPER')?>

<?DESCR100_3?>

<?xdofx:to_check_number(DESCR100_4, 'JPY', 'CASE_UPPER')?>

-----------------------------------------------------------------------------------------------------------------------------

Getting the distinct employees from the HEADER

<?for-each-group:HEADER;./EMPLID?>

-----------------------------------------------------------------------------------------------------------------------------<?xdoxslt:get_month(COMPLETED_DT,

$_XDOLOCALE)?>

<?for-each-group:current-group();./DESCRIPTION?>

<?for-each-group@section:HEADER;./EMPLID?>

<?for-each-group:current-group();./EMPLID?>

<?for-each-group@section:HEADER;./EMPLID?>

<?for-each-group:HEADER;./EMPLID?>

-----------------------------------------------------------------------------------------------------------------------------

, ROW_NUMBER() OVER(PARTITION BY A.EMPLID 

  ORDER BY A.EMPLID 

  ,A.STRM DESC) 

<?sum(name_off_field)?>

<?xdofx:if sum(name_off_field) = '1'?>

-----------------------------------------------------------------------------------------------------------------------------

Comments

Popular posts from this blog

BI Publisher: If Condition with sub-string in rtf template