You are on page 1of 32

07 Advanced RTF Template Techniques

Table of Contents
Table of Contents........................................................................................................................ 1
Associating XML Data................................................................................................................. 2
Know Your Data........................................................................................................................... 2
Looking at Raw XML Data........................................................................................................... 3
Looking at te !iel" #in"ow........................................................................................................ $
%n"erl&ing Tags........................................................................................................................... '
!or( !iel" Meto" Tags.............................................................................................................. '
!or( !iel" Meto" Tags.............................................................................................................. )
A""itional Tag *+ace................................................................................................................... ,
-re(arku+ La&out....................................................................................................................... .
*u++orte" /ati0e !or(atting !eatures........................................................................................ .
Designing te Te(+late La&out................................................................................................... 1
A"" Marku+................................................................................................................................. 1
2(ages an" Carts.................................................................................................................... 11
A""ing a Cart........................................................................................................................... 12
Cart *a(+le3 4ar Cart............................................................................................................ 13
Cart *a(+le3 -ie Cart............................................................................................................ 1$
Cart *a(+le3 4ar 5ori6ontal Cart........................................................................................... 1'
Cart *a(+le3 Line Cart.......................................................................................................... 1)
Drawing7 *a+e7 an" Cli+ Art *u++ort....................................................................................... 1,
8ter 9ra+ic !eatures............................................................................................................. 1,
Data:Dri0en *a+e *u++ort....................................................................................................... 1.
4ackgroun" an" #ater(ark *u++ort......................................................................................... 2;
Te(+late !eatures..................................................................................................................... 2;
Con"itional !or(atting............................................................................................................... 23
-age:Le0el Calculations............................................................................................................ 2,
Data 5an"ling............................................................................................................................ 21
<ariables7 -ara(eters7 an" -ro+erties...................................................................................... 3;
A"0ance" Re+ort La&outs.......................................................................................................... 32
1
Associating XML Data
In the previous lesson, you were told simply to include certain fields or type certain tags,
such as <!"#R$%A&#', (ut how do you )now what to enter or what to drag and
drop
Know Your Data
There is no *intelligent+ mapping mechanism within ,racle -I .u(lisher/ 0ou have to
)now something a(out the data you are using, and how that data is appearing in 1&2 to
your report/
There are two useful methods for e3ploring the data to understand it4
0ou can loo) at the raw 1&2 data/
0ou can loo) at the data structure in the Field window in ,racle -I
.u(lisher 5es)top/
6now 0our 5ata
Your te(+late content an" la&out (ust corres+on" to te content an" ierarc& of te in+ut
XML file. =ac "ata fiel" in &our te(+late (ust (a+ to an ele(ent in te XML file. =ac grou+
of re+eating ele(ents in &our te(+late (ust corres+on" to a +arent:cil" relationsi+ in te
XML file. To (a+ te "ata fiel"s &ou "efine placeholders. To "esignate te re+eating ele(ents7
&ou "efine groups.
2
Looking at Raw XML Data
-ecause you have a (asic understanding of 1&2, this is a snippet of 1&2 data as a
sample/ 7%ote4 This is a portion of the file/ "o, the closing tags are not all present/8
Raw 1&2 5ata
=ac "ata fiel" in &our re+ort te(+late (ust corres+on" to an ele(ent in te XML file. #en
&ou (ark u+ &our te(+late "esign7 &ou "efine +laceol"ers for te XML ele(ents. Te
+laceol"er (a+s te te(+late re+ort fiel" to te XML ele(ent. At run ti(e7 te +laceol"er is
re+lace" b& te 0alue of te ele(ent of te sa(e na(e in te XML "ata file.
Tis is a goo" e>a(+le of "ata co(ing fro( an outsi"e source. 2n tis case7 te "ata was
+ro"uce" b& 8racle Re+orts running fro( witin an 8racle e4usiness *uite 11i "atabase7 an"
?uer&ing te user "ata fro( tat s&ste(. 2n or"er to reall& un"erstan" tis "ata7 &ou woul" a0e
to un"erstan" 8racle e4usiness *uite 11i securit&. 4ut7 it is not unco((on for XML co(ing
fro( oter s&ste(s to +ro"uce unnecessar& XML tags before te first tag of interest. 2n tis
"ata7 te first tag of interest is te @%*=RA/AM=B*Y*ADM2/@C%*=RA/AM=B tag.
/otice te grou+ "ata7 @9AR=*-*B7 beneat tat @%*=RA/AM=B tag.
Tis is te structure of &our "ata. 4ut7 it can be "ifficult to rea" all but 0er& si(+le XML "ata.
An"7 because it is "ifficult7 &ou can be +rone to (aking errors wen "oing so.
3
Looking at the Field Window
The Field window, called up (y choosing Insert ' Field from the menu, is much less error
prone, and it is easier to see ta(ular structures/
$
nderl!ing Tags
In the -asic method, it is o(vious to see the relation (etween the 1&2 data and the tag/
1&2 data 9 <!"#R$%A&#'
.laceholder 9 <!"#R$%A&#'
-ut, how does the Form Field method create tags
For" Field Method Tags
Right:clic) the field, and choose .roperties to open the Te3t Form Field ,ptions window/
'
For" Field Method Tags
;hoose the Add <elp Te3t (utton to see the tag
/ote tat te +laceol"er7 e0en wit te !or( !iel" (eto"7 is still @D%*=RA/AM=DB7 wic is
wat it woul" be if &ou use" te 4asic (eto".
)
Additional Tag #$ace
There are two places to put tags4 "tatus -ar 7first8 and <elp 6ey 7F=8 7second8/
Additional Tag "pace
Tere is a (aEor note to (ake at tis +oint. Tere is a li(itation of te !or( !iel" (eto". Te
*tatus 4ar +art of te A""itional 5el+ Te>t is li(ite" to 13. caracters. Te 5el+ Ke& F!1G +art
is li(ite" to 2'' caracters. Tese two areas are si(+l& concatenate" wit *tatus 4ar
a++earing first followe" b& 5el+ Ke&. *o7 in total7 &ou are li(ite" to 313 caracters. 2f &ou a0e
+laceol"ers tat stretc ca+abilities or use a"0ance" functions tat go be&on" 313 caracters7
for tat +laceol"er7 &ou will a0e to use te 4asic (eto".
,
%re"arku$ La!out
,racle -I .u(lisher converts all formatting that you apply in the word:processing
program to 1"2:F,/ -ut, some features of your word processor may not (e mappa(le to
1"2:F,/
#u$$orted &ati'e For"atting Features
>eneral features
Alignment
Ta(les
5ate fields
&ulticolumn page support
"upported %ative Formatting Features
9eneral features3
Large blocks of te>t
-age breaks
-age nu(bering
Align(ent3 *u++orte" for te>t7 gra+ics7 obEects7 an" tables
4i"irectional languages are an"le" auto(aticall& using &our wor":
+rocessing a++licationHs leftCrigt align(ent controls.
Tables3
/este" tables
Cell align(ent
Row an" colu(n s+anning
Table autofor(atting
Cell +atterns an" colors
Re+eating table ea"ers
-re0ent rows fro( breaking across +ages
!i>e":wi"t colu(ns
Date fiel"s3 Corres+on" to +ublising "ate7 not te re?uest run "ate.
Multicolu(n -age *u++ort3 enables &ou to use te (ulti+le colu(n function fro( Microsoft
#or" to +ublis &our out+ut.
!or (ore infor(ation on an& of tese su++orte" features7 see te 8racle 42 -ubliser %serHs
9ui"e.
.
Designing the Te"$late La!out
"elect the si?e, font, and alignment of te3t/
Insert (ullets and num(ering/
5raw (orders around paragraphs/
Include watermar)s/
Include images 7@pg, gif, or png8/
;reate ta(les and use ta(le autoformatting features/
Insert headers andAor footers/
Add Marku$
.laceholders4
<1&2 element tag name'
1&2 data value4 7e3ample8
<!"#R$%A&#'
>roups4 7e3ample8
<for:each4!"#R$%A&#'
<end for:each'
<eaders and footers4
!se native RTF headers and footers/
Add &ar)up
%ote4 You can easil& (i> (anual (arku+ wit tat "one in 8racle 42 -ubliser Deskto+. 2n fact7
8racle 42 -ubliser Deskto+ is Eust using te i""en !or( !iel" (eto" tat is a0ailable witin
Microsoft #or" 2;;; Fan" laterG.
Your te(+late content an" la&out (ust corres+on" to te content an" ierarc& of te in+ut
XML file. =ac "ata fiel" in &our te(+late (ust (a+ to an ele(ent in te XML file. =ac grou+
of re+eating ele(ents in &our te(+late (ust corres+on" to a +arent:cil" relationsi+ in te
XML file.
4& "efining a grou+7 &ou are notif&ing 8racle 42 -ubliser tat for each occurrence of an
ele(ent F+arentG7 &ou want te inclu"e" fiel"s Fcil"renG "is+la&e". At run ti(e7 8racle 42
-ubliser will loo+ troug te occurrences of te ele(ent an" "is+la& te fiel"s eac ti(e.
/ote tat te grou+ ele(ent (ust be a +arent of te re+eating ele(ents in te XML in+ut file.
2f &ou insert te grou+ing tags aroun" te>t or for(atting ele(ents7 te te>t
an" for(atting ele(ents between te grou+ tags will be re+eate".
2f &ou insert te tags aroun" a table7 te table will be re+eate".
1
2f &ou insert te tags aroun" te>t in a table cell7 te te>t in te table cell
between te tags will be re+eate".
2f &ou insert te tags aroun" two "ifferent table cells7 but in te sa(e table
row7 te single row will be re+eate".
2f &ou insert te tags aroun" two "ifferent table rows7 te rows between
te tags will be re+eate" Ftis "oes not inclu"e te row tat contains te
Ien" grou+J tagG.
<eaders and Footers
8racle 42 -ubliser su++orts te use of te nati0e RT! ea"er an" footer feature. To create a
ea"er or footer7 use te &our wor":+rocessing a++licationHs ea"er an" footer insertion tools.
As an alternati0e7 &ou can "efine an internal te(+late in te bo"& of &our te(+late7 an" ten call
tis subte(+late fro( te ea"er or footer region. *ee 5ea"er an" !ooter Te(+late Alternati0e
of te Oracle BI Publisher Users Guide.
2f &our te(+late re?uires (ulti+le ea"ers an" footers7 create te( b& using 8racle 42 -ubliser
tags to "efine te bo"& area of &our re+ort. #en &ou "efine te bo"& area7 te ele(ents
occurring before te beginning of te bo"& area will co(+ose te ea"er. Te ele(ents
occurring after te bo"& area will co(+ose te footer. %se te following tags to enclose te
bo"& area of &our re+ort3
@Dstart3bo"&DB
@Den" bo"&DB
%se te tags eiter "irectl& in te te(+late7 or in for( fiel"s.
At te ti(e of tis writing7 Microsoft #or" "oes not su++ort for( fiel"s in te ea"er an" footer.
You (ust7 terefore7 insert te +laceol"er s&nta> "irectl& into te te(+late Fbasic RT!
(eto"G7 or use te ea"er an" footer te(+late alternati0e.
Microsoft #or" "oes not allow for( fiel"s in te ea"er an" footer regions of a "ocu(ent. 2f &ou
re?uire (an& or co(+le> obEects in te ea"er or footer of &our re+ort7 tese regions can
beco(e "ifficult to rea" or un"erstan". As an alternati0e7 &ou can create ea"er an" footer
te(+lates in te bo"& of &our RT! te(+late "ocu(ent tat can ten be calle" fro( te ea"er
or footer region.
To create a te(+late witin &our te(+late7 si(+l& wra+ te contents of te internal te(+late wit
te following tags3
@Dte(+late3internaltemplate nameDB
@Den" te(+lateDB
were internalte(+late na(e is te na(e &ou assign to te ea"erCfooter te(+late.
Ten in te ea"erCfooter region7 si(+l& enter te following s&nta> to call tis te(+late3
@Dcall3internaltemplate nameDB
At run ti(e7 te contents of te internal te(+late will ren"er at te +osition of te call.
#3ample
Assu(e &ou a0e te following XML "ata3
@R=-8RTB
@C8M-A/YA/AM=B8racle@CC8M-A/YA/AM=B
@R=-8RTA/AM=B Accounts -a&ables K 2n0oice Listing@CR=-8RTA/AM=B
@R=-8RTADAT=B1st Lanuar& 2;;'@CR=-8RTADAT=B
@L=9ALAT=XTB-ri0ate an" Confi"ential@CL=9ALAT=XTB
1;
...
C@R=-8RTB
You want te C8M-A/YA/AM=7 R=-8RTA/AM=7 an" R=-8RTADAT= to be "is+la&e" in a
table in te ea"er of te re+ort. 2n te ea"er of &our te(+late7 enter te following3
@Dcall38ra5ea"erCB
At run ti(e7 te 8ra5ea"er te(+late will be ren"ere" in te ea"er of eac +age of te
"ocu(ent.
("ages and Charts
,racle -I .u(lisher supports several methods of including images or charts in an ,racle
-I .u(lisher report/
5irect insertion
!R2 reference
,A$&#5IA directory reference
Image retrieved from -2,- data
2everaging ,racle -usiness Intelligence -eans 7!I -eans8 to add charts
and graphs to an RTF template/
Images and ;harts
!or %RL reference7 "o te following3
1. 2nsert a "u((& i(age in &our te(+late. !or la&out +ur+oses7 it is best if te
"u((& i(age is te sa(e si6e7 in +i>el eigt an" wi"t7 as &our actual i(age.
2. 2n te !or(at -icture "ialog bo> Frigt:click on te i(age to o+enG7 select te
#eb tab. =nter te following s&nta> in te Alternati0e Te>t region3 url3
MNtt+3CCi(age.location.co(Ci(age:na(eHO
8AAM=D2A (eto" refers to onl& 8racle e4usiness *uite installations. 8terwise7 it is te sa(e
at te %RL reference wit te Alternati0e Te>t canging to3 url3MNPM8AAM=D2AOCi(age:na(eHO
2f &our "ata source is an 8racle 42 -ubliser Data Te(+late7 an" &our results XML contains
i(age "ata tat a" been store" as a 4L84 in te "atabase7 use te following s&nta> in a for(
fiel" inserte" in &our te(+late were &ou want te i(age to ren"er at run ti(e3
@fo3instrea(:foreign:obEect content t&+eQRimage/jpgRB
@>sl30alue:of selectQRIMAGEE!EME"#RCB
@Cfo3instra(:foreign:obEectB
were image/jpg is te M2M= t&+e of te i(age Foter o+tions (igt be3 i(ageCgif an"
i(ageC+ngG
An" IMAGEE!EME"# is te ele(ent na(e of te 4L84 in &our XML "ata.
/ote tat &ou can s+ecif& eigt an" wi"t attributes for te i(age to set its si6e in te
+ublise" re+ort. 8racle 42 -ubliser will scale te i(age to fit te bo> si6e tat &ou "efine. !or
e>a(+le7 to set te si6e of te e>a(+le abo0e to tree inces b& four inces7 enter te
following3
11
@fo3instrea(:foreign:obEect content t&+eQRi(ageCE+gR eigtQR3 in
R wi"tQR$ inRB
@>sl30alue:of selectQR2MA9=A=L=M=/TRCB
@Cfo3instra(:foreign:obEectB
*+ecif& in +i>els as follows3
@fo3instrea(:foreign:obEect content t&+eQRi(ageCE+gR eigtQR3;;
+>R wi"tQR$ +>RB
...
or in centi(eters3
@fo3instrea(:foreign:obEect content t&+eQRi(ageCE+gR eigtQR3 c(
R wi"tQR$ c(RB
...
or as a +ercentage of te original "i(ensions3
@fo3instrea(:foreign:obEect content t&+eQRi(ageCE+gR eigtQR3;;S
R wi"tQR3;;SRB
...
Adding a Chart
Insert a dummy image in your template to define the si?e and position of
the chart/
Add a definition for the chart to the Alternative Te3t (o3 of the dummy
image/ The chart definition requires 1"2 commands/
At run time, ,racle -I .u(lisher calls the appropriate -I -ean to render the
image that is insert into the final output/
Adding a ;hart
%ote4 !or (ore infor(ation7 see +g. 2K1) troug 2K2) in te Oracle BI Publisher Users
Guide.
Te +rocess generates a +laceol"er. Te te>t of tat +laceol"er can be 0iewe" b& rigt:
clicking te i(age +laceol"er7 coosing !o(at -icture7 an" ten selecting te #eb tab.
12
Chart #a"$le) *ar Chart
;hart "ample4 -ar ;hart
Tere are onl& four su++orte" cart t&+es.
4ar
-ie
4ar K 5ori6ontal
Line
13
Chart #a"$le) %ie Chart
1$
Chart #a"$le) *ar +ori,ontal Chart
1'
Chart #a"$le) Line Chart
1)
Drawing- #ha$e- and Cli$ Art #u$$ort
The following Auto"hape categories are supported4
2ines4 "traight, arrowed, connectors, curve, free:form, and scri((le
;onnectors4 ,nly straight connectors
-asic "hapes4 All shapes supported
-loc) Arrows4 All arrows supported
Flowchart4 All o(@ects supported
"tars and (anners4 All o(@ects supported
;allouts4 *2ine+ callouts not supported
;lip art4 To add images using the &icrosoft ;lip Art li(raries
.ther /ra$hic Features
Freehand drawing4 "upported
2ayering4 "upported
B:5 #ffects4 %ot currently supported
&icrosoft #quation4 "upported
,rgani?ation ;hart4 "upported
CordArt4 &ostly supported
%ote4 *o(e Microsoft #or"Art uses bit(a+ o+erations tat currentl& cannot be con0erte" to
*<9 F*calable <ector 9ra+icG. To use te unsu++orte" #or"Art in &our te(+late7 take a
screensot of te #or"Art an" sa0e it as an i(age Fgif7 E+eg7 or +ngG. Re+lace te #or"Art wit
te i(age.
1,
Data0Dri'en #ha$e #u$$ort
In addition to supporting the static shapes and features in your templates, ,racle -I
.u(lisher supports the manipulation of shapes (ased on incoming data or parameters,
as well/ The following manipulations are supported4
Replicate
&ove
;hange si?e
Add te3t
")ew
Rotate
5ata:5riven "hape "upport
=nter (ani+ulation co((an"s for a sa+e in te #eb tab of te sa+eHs +ro+erties "ialog bo>
Frigt:click7 !or(at Auto*a+e B #eb B Alternati0e Te>tG.
Replicating a "hape
You can re+licate a sa+e base" on inco(ing XML "ata in te sa(e wa& &ou re+licate "ata
ele(ents in a for:eac loo+. To "o tis7 use a for:eacTsa+e co((an" in conEunction wit a
sa+e:offset "eclaration. !or e>a(+le7 to re+licate a sa+e "own te +age7 use te following
s&nta>3
@Dfor:eacTsa+e3*5A-=A9R8%-DB
@Dsa+e:offset:&3F+ositionFG:1GU1;;DB
@Den" for:eacDB
were
for:eacTsa+e o+ens te for:eac loo+ for te sa+e conte>t
*5A-=A9R8%- is te na(e of te re+eating ele(ent fro( te XML file. !or eac occurrence
of te *5A-=A9R8%- ele(ent7 a new sa+e will be create".
sa+e:offset:&3 2s te co((an" to offset te sa+e along te &:a>is. F+ositionFG:1GU1;;G sets te
offset in +i>els +er occurrence. Te X*L +osition co((an" returns te recor" counter in te
grou+ Ftat is7 17 27 37 $7 an" so onGV one is subtracte" fro( tat nu(ber an" te result is
(ulti+lie" b& 1;;. Terefore7 for te first occurrence7 te offset woul" be ;3 F1:1G U 1;;. Te
offset for te secon" occurrence woul" be 1;; +i>els3 F2:1G U1;;. An" for eac subse?uent
occurrence7 te offset woul" be anoter 1;; +i>els "own te +age.
Adding Te3t to a "hape
You can a"" te>t to a sa+e "&na(icall& eiter fro( te inco(ing XML "ata or fro( a
+ara(eter 0alue. 2n te +ro+erties "ialog bo>7 enter te following s&nta>3
@Dsa+e:te>t3*5A-=T=XTDB
were *5A-=T=XT is te ele(ent na(e in te XML "ata. At run ti(e7 te te>t will be inserte"
into te sa+e.
Adding Te3t Along a .ath
You can a"" te>t along a line or cur0e fro( inco(ing XML "ata or a +ara(eter. After "rawing
te line7 in te +ro+erties "ialog bo> enter3
1.
@Dsa+e:te>t:along:+at3*5A-=T=XTDB
were *5A-=T=XT is te ele(ent fro( te XML "ata. At runti(e te 0alue of te *5A-=T=XT
ele(ent will be inserte" abo0e an" along te line.
&oving a "hape
You can (o0e a sa+e or trans+ose it along bot te > an" & a>es base" on te XML "ata. !or
e>a(+le7 to (o0e a sa+e 2;; +i>els along te &:a>is an" 3;; along te >:a>is7 enter te
following co((an"s in te +ro+erties "ialog bo> of te sa+e3
@Dsa+e:offset:>33;;DB
@Dsa+e:offset:&32;;DB
Rotating a "hape
To rotate a sa+e about a s+ecifie" a>is base" on te inco(ing "ata7 use te following
co((an"3
@Dsa+e:rotate3A/9L=VH-8*2T28/HDB
were
A/9L= is te nu(ber of "egrees to rotate te sa+e. 2f te angle is +ositi0e7 te rotation is
clockwiseV if negati0e7 te rotation is counterclockwise.
-8*2T28/ is te +oint about wic to carr& out te rotation7 for e>a(+le7 IleftCto+.J <ali" 0alues
are co(binations of left7 rigt7 or center wit center7 to+7 or botto(. Te "efault is leftCto+.
")ewing a "hape
You can skew a sa+e along its > or & a>is using te following co((an"s3
@Dsa+e:skew:>3A/9L=VH-8*2T28/HDB
@Dsa+e:skew:&3A/9L=VH-8*2T28/HDB
were
A/9L= is te nu(ber of "egrees to skew te sa+e. 2f te angle is +ositi0e7 te skew is to te
rigt.
-8*2T28/ is te +oint about wic to carr& out te rotation7 for e>a(+le7 IleftCto+.J <ali" 0alues
are co(binations of left7 rigt7 or center wit center7 to+7 or botto(. Te "efault is leftCto+.
!or e>a(+le7 to skew a sa+e b& 3; "egrees about te botto( rigt corner7 enter te following3
@Dsa+e:skew:>3nu(berF.GU3;VHrigtCbotto(HDB
;hanging the "i?e of a "hape
You can cange te si6e of a sa+e using te a++ro+riate co((an"s eiter along a single a>is
or along bot a>es. To cange a sa+eHs si6e along bot a>es7 use3
@Dsa+e:si6e3RAT28DB
were RAT28 is te nu(eric ratio to increase or "ecrease te si6e of te sa+e. Terefore7 a
0alue of 2 woul" generate a sa+e twice te eigt an" wi"t of te original. A 0alue of ;.'
woul" generate a sa+e alf te si6e of te original. To cange a sa+eHs si6e along te > or &
a>is7 use3
@Dsa+e:si6e:>3RAT28DB
@Dsa+e:si6e:&3RAT28DB
Canging onl& te > or & 0alue as te effect of stretcing or srinking te sa+e along an a>is.
Tis can be "ata "ri0en.
11
*ackground and Water"ark #u$$ort
,racle -I .u(lisher supports the -ac)ground feature in &icrosoft Cord/ 0ou can specify
a single, graduated color or an image (ac)ground for your template to (e displayed in
the .5F output/ %ote that this feature is supported for .5F output only/
To add a (ac)ground to your template, use the Format ' -ac)ground menu option/
In &icrosoft Cord D00D or later, you can add a te3t or image watermar) via Format '
-ac)ground ' .rinted Catermar)/
Te"$late Features
.age (rea)s
Initial page num(ers
<yperlin)s
Ta(le of contents
-oo)mar)s in .5F output
;hec) (o3es
5rop:down lists
Template Features
.age -rea)s
To create a +age break after te occurrence of a s+ecific ele(ent7 use te s+lit:b&:+age:break
alias. Tis will cause te re+ort out+ut to insert a ar" +age break between e0er& instance of a
s+ecific ele(ent. You can also insert a for( fiel" i((e"iatel& following te for( fiel" of te
ele(ent &ou want te +age break to occur after. 2n te 5el+ Te>t of tis for( fiel"7 enter te
s&nta>3
@Ds+lit:b&:+age:break3DB
Initial .age %um(ers
*o(e re+orts re?uire tat te initial +age nu(ber be set at a s+ecifie" nu(ber. !or e>a(+le7
(ontl& re+orts (a& be re?uire" to continue nu(bering fro( (ont to (ont. 8racle 42
-ubliser allows &ou to set te +age nu(ber in te te(+late to su++ort tis re?uire(ent.
%se te following s&nta> in &our te(+late to set te initial +age nu(ber3
@Dinitial:+age:nu(ber3pagenumberDB
were pagenumber is te XML ele(ent or +ara(eter tat ol"s te nu(eric 0alue.
2f &our XML "ata contains an ele(ent to carr& te initial +age nu(ber7 for e>a(+le3
@R=-8RTB
@-A9=*TARTB2;;@W-A9=*TARTB
....
@CR=-8RTB
=nter te following in &our te(+late3
2;
@Dinitial:+age:nu(ber3-A9=*TARTDB
Your initial +age nu(ber will be te 0alue of te -A9=*TART ele(ent7 wic in tis case is
2;;.
=>a(+le 23 *et +age nu(ber b& +assing a +ara(eter 0alue.
2f &ou "efine a +ara(eter calle" -A9=*TART7 &ou can +ass te initial 0alue b& calling te
+ara(eter.
=nter te following in &our te(+late3
@Dinitial:+age:nu(ber3P-A9=*TARTDB
%ote4 You (ust first "eclare te +ara(eter in &our te(+late. *ee IDefining -ara(eters in Your
Te(+lateJ in te Oracle BI Publisher Users Guide.
<yperlin)s
You can a"" fi>e" or "&na(ic &+erlinks to &our te(+late.
To insert static &+erlinks7 use &our wor":+rocessing a++licationHs insert
&+erlink feature.
2f &our te(+late inclu"es a "ata ele(ent tat contains a &+erlink or +art
of one7 &ou can create "&na(ic &+erlinks at run ti(e. 2n te Type the
file or Ce( page name fiel" of te Insert <yperlin) "ialog bo>7 enter te
following s&nta>3
M%RLAL2/KO
were %RLAL2/K is te inco(ing "ata ele(ent na(e.
2f &ou a0e a fi>e" %RL tat &ou want to +ass +ara(eters to7 enter te
following s&nta>3
tt+3CCwww.oracle.co(D+ro"uctQM-R8D%CTA/AM=O
were -R8D%CTA/AM= is te inco(ing "ata ele(ent na(e.
2n bot tese cases7 at run ti(e te "&na(ic %RL will be constructe".
Ta(le of ;ontents
8racle 42 -ubliser su++orts te table of contents generation feature of te RT! s+ecification.
!ollow &our wor":+rocessing a++licationHs +roce"ures for inserting a
table of contents. 8racle 42 -ubliser also +ro0i"es te abilit& to create "&na(ic section
ea"ings in &our "ocu(ent fro( te XML "ata. You can ten incor+orate tese into a table of
contents.
To create "&na(ic ea"ings3
1. =nter a +laceol"er for te ea"ing in te bo"& of te "ocu(ent7 an"
for(at it as a I5ea"ing7J using &our wor":+rocessing a++licationHs st&le
feature. You cannot use for( fiel"s for tis functionalit&.
!or e>a(+le7 &ou want &our re+ort to "is+la& a ea"ing for eac
co(+an& re+orte". Te XML "ata ele(ent tag na(e is
@C8M-A/YA/AM=B. 2n &our te(+late7 enter @D
C8M-A/YA/AM=DB were &ou want te ea"ing to a++ear.
/ow for(at te te>t as a 5ea"ing.
2. Create a table of contents using &our wor":+rocessing a++licationHs table
of contents feature.
3. At run ti(e7 te T8C +laceol"ers an" ea"ing te>t will be substitute".
>enerating -oo)mar)s in .5F ,utput
21
2f &ou a0e "efine" a table of contents in &our RT! te(+late7 &ou can use &our table of contents
"efinition to generate links in te 4ook(arks tab in te na0igation +ane of &our out+ut -D!. Te
book(arks can be eiter static or "&na(icall& generate".
To create links for a static table of contents7 enter te s&nta>3
@Dco+&:to:book(ark3DB
"irectl& abo0e &our table of contents an"
@Den" co+&:to:book(ark3DB
"irectl& below te table of contents.
To create links for a "&na(ic table of contents7 use3
@Dcon0ert:to:book(ark3DB
"irectl& abo0e te table of contents an"
@Den" con0ert:to:book(ark3DB
"irectl& below te table of contents.
;hec) -o3es
You can inclu"e a ceck bo> in &our te(+late tat &ou can "efine to "is+la& as selecte"
FCecke"G or "eselecte" F/ot Cecke"G base" on a 0alue fro( te inco(ing "ata. To "efine a
ceck bo> in &our te(+late3
1. -osition te cursor in &our te(+late were &ou want te ceck bo> to
a++ear7 an" select te Ceck 4o> !or( !iel" fro( te !or(s tool bar.
2. Rigt:click te fiel" to o+en te ;hec) -o3 Form Field ,ptions "ialog
bo>.
3. *+ecif& te 5efault value as eiter Cecke" or /ot Cecke".
$. 2n te !or( !iel" 5el+ Te>t "ialog bo>7 enter te criteria for ow te bo>
soul" bea0e. Tis (ust be a 4oolean e>+ression Ftat is7 one tat
returns a true or false resultG. !or e>a(+le7 su++ose &our XML "ata
contains an ele(ent calle" @+o+ulationB. You want te ceck bo> to
a++ear selecte" if te 0alue of @+o+ulationB is greater tan 1;7;;;. =nter
te following in te el+ te>t fiel"3 @D+o+ulationB1;;;;DB
'. /ote tat &ou "o not a0e to construct an IifJ state(ent. Te e>+ression
is treate" as an IifJ state(ent.
5rop:5own 2ists
8racle 42 -ubliser allows &ou to use te "ro+:"own for( fiel" to create a cross:reference in
&our te(+late fro( &our XML "ata to so(e oter 0alue tat &ou "efine in te "ro+:"own for(
fiel". !or e>a(+le7 su++ose &ou a0e te following XML3
@countriesB
@countr&B
@na(eBCa"@Cna(eB
@+o+ulationB,3);;;;@C+o+ulationB
@continent2n"e>B'@Ccontinent2n"e>B
@Ccountr&B
@countr&B
@na(eBCina@Cna(eB
@+o+ulationB12)''3;;;;@C+o+ulationB
@continent2n"e>B1@Ccontinent2n"e>B
22
@Ccountr&B
@countr&B
@na(eBCile@Cna(eB
@+o+ulationB1$),,;;;@C+o+ulationB
@continent2n"e>B3@Ccontinent2n"e>B
@Ccountr&B
. . .
@CcountriesB
/otice tat eac @countr&B entr& as a @continentin"e>B entr&7 wic is a nu(eric 0alue to
re+resent te continent. %sing te "ro+:"own for( fiel"7 &ou can create an in"e> in &our
te(+late tat will cross:reference te @continentin"e>B 0alue to te actual continent na(e. You
can ten "is+la& te na(e in &our +ublise" re+ort. To create te in"e> for te continent
e>a(+le3
1. -osition te cursor in &our te(+late were &ou want te 0alue fro( te
"ro+:"own list to "is+la&7 an" select te Dro+:Down !or( !iel" fro( te
!or(s tool bar.
2. Rigt:click te fiel" to "is+la& te 5rop:5own Form Field ,ptions "ialog
bo>.
3. A"" eac 0alue to te 5rop:down item fiel" an" te click Add to a"" it to
te Items in drop:down list grou+. Te 0alues will be in"e>e" starting
fro( one for te first7 an" so on. !or e>a(+le7 te list of continents will be
store" as follows3
Inde3 Ealue
1 Asia
2 /ort A(erica
3 *out A(erica
$ =uro+e
' Africa
) Australia
/ow use te 5el+ Te>t bo> to enter te XML ele(ent na(e tat will ol" te in"e> for te "ro+:
"own fiel" 0alues. !or tis e>a(+le7 enter @Dcontinent2n"e>DB
Conditional For"atting
if statements
if statements in (oilerplate te3t
if:then:else statements
choose statements
;olumn formatting
Row formatting
;ell highlighting
23
;onditional Formatting
Con"itional for(atting occurs wen a for(atting ele(ent a++ears onl& wen a certain con"ition
is (et. 8racle 42 -ubliser su++orts te usage of si(+le if state(ents7 as well as (ore co(+le>
coose e>+ressions. Te con"itional for(atting tat &ou s+ecif& can be X*L or X*L3!8 co"e7 or
&ou can s+ecif& actual RT! obEects suc as a table or "ata. !or e>a(+le7 &ou can s+ecif& tat if
re+orte" nu(bers reac a certain tresol"7 te& will "is+la& sa"e" in re". 8r7 &ou can use tis
feature to i"e table colu(ns or rows "e+en"ing on te inco(ing XML "ata.
if "tatements
%se an if state(ent to "efine a si(+le con"itionV for e>a(+le7 if a "ata fiel" is a s+ecific 0alue.
2nsert te following s&nta> to "esignate te beginning of te con"itional
area. @Dif3conditionDB
2nsert te following s&nta> at te en" of te con"itional area3 @Den" ifDB.
!or e>a(+le7 to set u+ te -a&ables 2n0oice Register to "is+la& in0oices onl& wen te *u++lier
na(e is RCo(+an& AR7 insert te s&nta> @Dif3<=/D8RA/AM=QHC8M-A/YAHDB before te
*u++lier fiel" on te te(+late. =nter te @Den" ifDB tag after te in0oices table.
/ote tat &ou can insert te s&nta> in for( fiel"s7 or "irectl& into te te(+late.
if "tatements in -oilerplate Te3t
Assu(e &ou want to incor+orate an if state(ent into te following free:for( te>t3
Te +rogra( was FnotG successful.
You onl& want te InotJ to "is+la& if te 0alue of an XML tag calle" @*%CC=**B e?uals I/J. To
acie0e tis re?uire(ent7 &ou (ust use te 8racle 42 -ubliser conte>t co((an" to +lace te if
state(ent into te inline se?uence rater tan into te block Fte "efault +lace(entG. %ote4 !or
(ore infor(ation on conte>t co((an"s7 see I%sing Conte>t Co((an"sJ in te Oracle BI
Publisher Users Guide.
!or e>a(+le7 if &ou construct te co"e as follows3
Te +rogra( was @Dif3*%CC=**QH/HDBnot@Den" ifDB successful.
Te following un"esirable result will occur3
Te +rogra( was
not
successful.
because 8racle 42 -ubliser a++lies te instructions to te block b& "efault. To s+ecif& tat te
if state(ent soul" be inserte" into te inline se?uence7 enter te following3
Te +rogra( was @DifTinlines3*%CC=**QH/HDBnot@Den" ifDB
successful.
Tis construction will result in one of two "is+la&s. 2f *%CC=** "oes not e?ual N/H7 te "is+la&
will be Te +rogra( was successful. 2f *%CC=** e?uals N/H7 te "is+la& will be Te +rogra(
was not successful.
if:then:else "tatements
8racle 42 -ubliser su++orts te co((on +rogra((ing construct Iif:ten:else.J Tis is
e>tre(el& useful wen &ou nee" to test a con"ition an" con"itionall& sow a result. !or
e>a(+le3
2! XQ; T5=/
YQ2
2$
=L*=
YQ3
=/D 2!
You can also nest tese state(ents as follows3
2! XQ; T5=/
YQ2
=L*=
2! XQ1 T5=/
YQ1;
=L*= YQ1;;
=/D 2!
%se te following s&nta> to construct an if:ten:else state(ent in &our RT! te(+late3
@D>"of>3if elementcondition ten result$ else result% en" ifDB
!or e>a(+le7 te following state(ent tests te AM8%/T ele(ent 0alue. 2f te 0alue is greater
tan 1;;;7 sow te wor" R5igerRV if it is less tan 1;;;7 sow te wor" RLowerRV if it is e?ual to
1;;;7 sow R=?ualR3
@D>"of>3if AM8%/T B 1;;; ten H5igerH
else
if AM8%/T @ 1;;; ten HLowerH
else
H=?ualH
en" ifDB
choose "tatements
%se te coose7 wen7 an" oterwise ele(ents to e>+ress (ulti+le con"itional tests. 2f certain
con"itions are (et in te inco(ing XML "ata7 ten s+ecific sections of te te(+late will be
ren"ere". Tis is a 0er& +owerful feature of te RT! te(+late. 2n regular X*L +rogra((ing7 if a
con"ition is (et in te coose co((an"7 ten furter X*L co"e is e>ecute". 2n te te(+late7
owe0er7 &ou can actuall& use 0isual wi"gets in te con"itional flow Fin te following e>a(+le7 a
tableG. %se te following s&nta> for tese ele(ents3
@Dcoose3DB
@Dwen3e&pressionDB
@DoterwiseDB
;olumn Formatting
You can con"itionall& sow an" i"e colu(ns of "ata in &our "ocu(ent out+ut. Te following
e>a(+le "e(onstrates ow to set u+ a table so tat a colu(n is onl& "is+la&e" base" on te
0alue of an ele(ent attribute. Tis e>a(+le will sow a re+ort of a +rice list7 re+resente" b& te
following XML3
@ite(s t&+eQR-%4L2CRB @X : can be (arke" N-R2<AT=H : B
@ite(B
@na(eB-las(a T<@Cna(eB
@?uantit&B1;@C?uantit&B
@+riceB$;;;@C+riceB
@Cite(B
@ite(B
2'
@na(eBD<D -la&er@Cna(eB
@?uantit&B3@C?uantit&B
@+riceB3;;@C+riceB
@Cite(B
@ite(B
@na(eB<CR@Cna(eB
@?uantit&B2;@C?uantit&B
@+riceB2;;@C+riceB
@Cite(B
@ite(B
@na(eBRecei0er@Cna(eB
@?uantit&B22@C?uantit&B
@+riceB3';@C+riceB
@Cite(B
@Cite(sB
/otice te t&+e attribute associate" wit te ite(s ele(ent. 2n tis XML it is (arke" as
R-%4L2CR (eaning te list is a +ublic list rater tan a R-R2<AT=R list. !or te I+ublicJ 0ersion of
te list7 &ou "o not want to sow te ?uantit& colu(n in te out+ut7 but &ou want to "e0elo+ onl&
one te(+late for bot 0ersions base" on te list t&+e.
Row Formatting
8racle 42 -ubliser allows &ou to s+ecif& for(atting con"itions as te row:le0el of a table.
=>a(+les of row:le0el for(atting are3
5igligting a row wen te "ata (eets a certain tresol".
Alternating backgroun" colors of rows to ease rea"abilit& of re+orts.
*owing onl& rows tat (eet a s+ecific con"ition.
;onditionally 5isplaying a Row
To "is+la& onl& rows tat (eet a certain con"ition7 insert te @Dif3conditionDB @Den" ifDB tags at
te beginning an" en" of te row7 witin te for:eac tags for te grou+. Tis is "e(onstrate" in
te following sa(+le te(+late.
;ell <ighlighting
Te co"e to igligt te "ebit colu(n as sown in te table is3
@Dif3"ebitB1;;;DB
@>sl3attribute
>"ofo3ct>QRblockR na(eQRbackgroun":colorRBre"
@C>sl3attributeB
@Den" ifDB
Te RifR state(ent is testing if te "ebit 0alue is greater tan 1;;;. 2f it is7 ten te ne>t lines are
in0oke". /otice tat te e>a(+le e(be"s nati0e X*L co"e insi"e te RifR state(ent. Te
RattributeR ele(ent allows &ou to (o"if& +ro+erties in te X*L. Te >"ofo3ct> co(+onent is an
8racle 42 -ubliser feature tat allows &ou to a"Eust X*L attributes at an& le0el in te te(+late.
2n tis case7 te backgroun" color attribute is cange" to re". To cange te color attribute7 &ou
can use eiter te stan"ar" 5TML na(es Ffor e>a(+le7 re"7 wite7 greenG or &ou can use te
e>a"eci(al color "efinition Ffor e>a(+le7 Y!!!!!G.
2)
%age0Le'el Calculations
.age totals
-rought forward or carried forward totals
Running totals
.age:2evel ;alculations
5isplaying .age Totals
8racle 42 -ubliser allows &ou to "is+la& calculate" +age totals in &our re+ort. 4ecause te
+age is not create" until +ublising ti(e7 te totaling function (ust be e>ecute" b& te
for(atting engine. %ote4 -age totaling is +erfor(e" in te -D!:for(atting la&er. Terefore tis
feature is not a0ailable for oter out+uts t&+es3 5TML7 RT!7 =>cel.
4ecause te +age total fiel" "oes not e>ist in te XML in+ut "ata7 &ou (ust "efine a 0ariable to
ol" te 0alue. #en &ou "efine te 0ariable7 &ou associate it wit te ele(ent fro( te XML
file tat is to be totale" for te +age. 8nce &ou "efine total fiel"s7 &ou can also +erfor(
a""itional functions on te "ata in tose fiel"s.
To "eclare te 0ariable tat is to ol" &our +age total7 insert te following s&nta> i((e"iatel&
following te +laceol"er for te ele(ent tat is to be totale"3
@Da"":+age:total3#otal'ield"ameVHelementHDB
were
Total!iel"/a(e is te na(e &ou assign to &our total Fto reference laterG
an"
Hele(entH is te XML ele(ent fiel" to be totale".
You can a"" tis s&nta> to as (an& fiel"s as &ou want to total. Ten wen &ou want to "is+la&
te total fiel"7 enter te following s&nta>3
@Dsow:+age:total3#otal'ield"ameVHnumber(formatHDB
were
Total!iel"/a(e is te na(e &ou assigne" to gi0e te +age total fiel"
abo0e an"
nu(ber:for(at is te for(at &ou wis to use to for te "is+la&.
/ote tat tis +age totaling function will onl& work if &our source XML as raw nu(eric 0alues.
Te nu(bers (ust not be +refor(atte".
-rought ForwardA;arried Forward Totals
Man& re+orts re?uire tat a +age total be (aintaine" trougout te re+ort out+ut an" be
"is+la&e" at te beginning an" en" of eac +age. Tese totals are known as Rbrougt
forwar"Ccarrie" forwar"R totals. %ote4 Te totaling for te brougt forwar" an" carrie" forwar"
fiel"s is +erfor(e" in te -D!:for(atting la&er. Terefore tis feature is not a0ailable for oter
out+uts t&+es3 5TML7 RT!7 =>cel.
To "is+la& te brougt forwar" total at te to+ of eac +age Fe>ce+t te firstG7 use te following
s&nta>3
@>"ofo3inline:total
2,
"is+la& con"itionQRe>ce+tfirstR
na(eQR2n0A(tRB
4rougt !orwar"3
@>"ofo3sow:brougt:forwar"
na(eQR2n0A(tR
for(atQR1191119111D;;RCB
@C>"ofo3inline:totalB
Te following table "escribes te ele(ents co(+rising te brougt forwar" s&nta>3
;ode #lement 5escription and !sage
inline:total Tis ele(ent as two +ro+erties3
na(e : na(e of te 0ariable &ou "eclare" for te fiel".
"is+la&:con"ition : sets te "is+la& con"ition. Tis is an
o+tional +ro+ert& tat takes one of te following 0alues3
first : te contents a++ear onl& on te first +age
last : te contents a++ear onl& on te last +age
e>ce+tfirst : contents a++ear on all +ages e>ce+t first
e>ce+tlast : contents a++ear on all +ages e>ce+t last
e0er&ti(e : F"efaultG contents a++ear on e0er& +age
2n tis e>a(+le7 "is+la&:con"ition is set to Re>ce+tfirstR to
+re0ent te 0alue fro( a++earing on te first +age were te
0alue woul" be 6ero.
4rougt !orwar"3 Tis string is o+tional an" will "is+la& as te fiel" na(e on te
re+ort.
sow:brougt:forwar" *ows te 0alue on te +age. 2t as te following two +ro+erties3
na(e : te na(e of te fiel" to sow. 2n tis case7 R2n0A(tR. Tis
+ro+ert& is (an"ator&.
for(at : te 8racle nu(ber for(at to a++l& to te 0alue at
runti(e. Tis +ro+ert& is o+tional. !or (ore infor(ation about
nu(ber for(ats7 see /u(ber an" Date !or(atting.
2nsert te brougt forwar" obEect at te to+ of te te(+late were &ou want te brougt forwar"
total to "is+la&. 2f &ou +lace it in te bo"& of te te(+late7 &ou can insert te s&nta> in a for(
fiel". 2f &ou want te brougt forwar" total to "is+la& in te ea"er7 &ou (ust insert te full co"e
string into te ea"er because Microsoft #or" "oes not su++ort for( fiel"s in te ea"er or
footer regions. 5owe0er7 &ou can alternati0el& use te 5ea"erC!ooter Te(+late Tecni?ue
wic allows &ou to enter &our ea"er an" footer content witin te bo"& of te te(+late an"
ten si(+l& inclu"e a call for tis content in te ea"er or footer region. Tis can si(+lif& te
look of &our te(+late if &ou a0e (an& or co(+le> obEects containe" in &our ea"er or footer
regions. *ee 5ea"er an" !ooter Te(+late for "etails.
-lace te carrie" forwar" obEect at te botto( of &our te(+late were &ou want te total to
"is+la&. Te carrie" forwar" obEect for our e>a(+le is as follows3
@>"ofo3inline:total
"is+la& con"itionQRe>ce+tlastR
na(eQR2n0A(tRB
Carrie" !orwar"3
2.
@>"ofo3sow:carr&:forwar"
na(eQR2n0A(tR
for(atQR1191119111D;;RCB
@C>"ofo3inline:totalB
/ote te following "ifferences wit te brougt:forwar" obEect3
Te "is+la&:con"ition is set to e>ce+tlast so tat te carrie" forwar" total
will "is+la& on e0er& +age e>ce+t te last +age.
Te "is+la& string is RCarrie" !orwar"R.
Te sow:carr&:forwar" ele(ent is use" to sow te carrie" forwar"
0alue. 2t as te sa(e +ro+erties as brougt:carrie":forwar"7 "escribe"
abo0e.
You are not li(ite" to a single 0alue in &our te(+late7 &ou can create (ulti+le brougt
forwar"Ccarrie" forwar" obEects in &our te(+late +ointing to 0arious nu(eric ele(ents in &our
"ata.
Running Totals
To create te Running Total fiel"7 "efine a 0ariable to track te total an" initiali6e it to ;.
Data +andling
"orting
Regrouping
5ata <andling
"orting
You can sort a grou+ b& an& ele(ent witin te grou+. 2nsert te following s&nta> witin te
grou+ tags3
@Dsort3element nameDB
To sort te e>a(+le b& *u++lier F<=/D8RA/AM=G7 enter te following after te @Dfor:
eac39A<=/D8RA/AM=DB tag3
@Dsort3<=/D8RA/AM=DB
To sort a grou+ b& (ulti+le fiel"s7 Eust insert te sort s&nta> after te +ri(ar& sort fiel". To sort
b& *u++lier an" ten b& 2n0oice /u(ber7 enter te following3
@Dsort3<=/D8RA/AM=DB @Dsort32/<82C=A/%MDB
Regrouping the 1&2 5ata
Te RT! te(+late su++orts te X*L 2.; for:eac:grou+ stan"ar" tat allows &ou to regrou+
XML "ata into ierarcies tat are not +resent in te original "ata. #it tis feature7 &our
te(+late "oes not a0e to follow te ierarc& of te source XML file. You
are terefore no longer li(ite" b& te structure of &our "ata source.
21
1ariables- %ara"eters- and %ro$erties
Earia(les, .arameters, and .roperties
!sing Earia(les
%+"ateable 0ariables "iffer fro( stan"ar" X*L 0ariables @>sl30ariableB in tat te& are
u+"ateable "uring te te(+late a++lication to te XML "ata. Tis allows &ou to create (an&
new features in &our te(+lates tat re?uire u+"ateable 0ariables. Te 0ariables use a Rset an"
getR a++roac for assigning7 u+"ating7 an" retrie0ing 0alues. %se te following s&nta> to
"eclareCset a 0ariable 0alue3
@D>"o>slt3setA0ariableFPAXD8CTX7 H)ariable nameH7 )alueGDB
%se te following s&nta> to retrie0e a 0ariable 0alue3
@D>"o>slt3getA0ariableFPAXD8CTX7 H)ariable nameHGDB
You can use tis (eto" to +erfor( calculations. !or e>a(+le3
@D>"o>slt3setA0ariableFPAXD8CTX7 H>H7 >"o>slt3getA0ariableFPAXD8CTX7
H>H Z 1GDB
Tis sets te 0alue of 0ariable N>H to its original 0alue +lus 17 (uc like using R> Q > Z 1R. Te
PAXD8CTX s+ecifies te global "ocu(ent conte>t for te 0ariables. 2n a (ultitrea"e"
en0iron(ent tere (a& be (an& transfor(ations occurring at te sa(e ti(e7 terefore te
0ariable (ust be assigne" to a single transfor(ation. *ee te section on Running Totals for an
e>a(+le of te usage of u+"ateable 0ariables.
5ening .arameters
You can +ass run:ti(e +ara(eter 0alues into &our te(+late. Tese can ten be reference"
trougout te te(+late to su++ort (an& functions. !or e>a(+le7 &ou can filter "ata in te
te(+late7 use a 0alue in a con"itional for(atting block7 or +ass +ro+ert& 0alues Fsuc
as securit& settingsG into te final "ocu(ent.
%ote4 Te 8racle A++lications concurrent (anager "oes not su++ort +assing +ara(eter 0alues
into te te(+late. Te +ara(eters (ust be +asse" +rogra((aticall& using te A-2s as
"escribe" below.
!sing a parameter in a template
Declare te +ara(eter in te te(+late. %se te following s&nta> to
"eclare te +ara(eter3
@>sl3+ara( na(eQRPA*AME#E*"AMER selectQRD=!A%LTR >"ofo3ct>QRbeginRCB
were
PA*AME#E*"AME is te na(e of te +ara(eter
D=!A%LT is te "efault 0alue for te +ara(eter Fte select state(ent is o+tionalG
>"ofo3ct>QRbeginR is a re?uire" string to +us te +ara(eter "eclaration to te to+ of te
te(+late at runti(e so tat it can be referre" to globall& in te te(+late. Te s&nta> (ust be
"eclare" in te 5el+ Te>t fiel" of a for( fiel". Te for( fiel" can be +lace" an&were in te
te(+late.
3;
Refer to te +ara(eter in te te(+late b& +refi>ing te na(e wit a RPR
caracter. !or e>a(+le7 if &ou "eclare te +ara(eter na(e to be
R2n0TresR7 ten reference te 0alue using RP2n0TresR.
At run ti(e7 +ass te +ara(eter to te 8racle 42 -ubliser engine
+rogra((aticall&. -rior to calling eiter te !8-rocessor A-2 FCoreG or
te Te(+late5el+er A-2 F=:4usiness *uiteG create a -ro+erties class an"
assign a +ro+ert& to it for te +ara(eter 0alue as follows3
-ro+erties +ro+ Q new -ro+ertiesFGV
+ro+.+utFR>slt.2n0TresR7 R1;;;RGV
!or (ore infor(ation7 see Calling 8racle 42 -ubliser A-2s.
"etting .roperties
8racle 42 -ubliser +ro+erties tat are a0ailable in te 8racle 42 -ubliser Configuration file can
alternati0el& be e(be""e" into te RT! te(+late. Te +ro+erties set in te te(+late are
resol0e" at run ti(e b& te 8racle 42 -ubliser engine. You can eiter ar":co"e te 0alues in
te te(+late or e(be" te 0alues in te inco(ing XML "ata. =(be""ing te +ro+erties in te
te(+late a0oi"s te use of te configuration file.
%ote4 *ee I8racle 42 -ubliser Configuration !ileJ for (ore infor(ation about te 8racle 42
-ubliser Configuration file an" te a0ailable +ro+erties.
!or e>a(+le7 if &ou use a nonstan"ar" font in &our te(+late7 rater tan s+ecif& te font location
in te configuration file7 &ou can e(be" te font +ro+ert& insi"e te te(+late. 2f &ou nee" to
secure te generate" -D! out+ut7 &ou can use te 8racle 42 -ubliser -D! securit& +ro+erties
an" obtain te +asswor" 0alue fro( te inco(ing XML "ata. To a"" an 8racle 42 -ubliser
+ro+ert& to a te(+late7 use te Microsoft #or" .roperties "ialog bo> Fa0ailable fro( te File
(enuG7 an" enter te following infor(ation3
%ame : enter te 8racle 42 -ubliser +ro+ert& na(e +refi>e" wit R>"o:R
Type : select RTe>tR
Ealue : enter te +ro+ert& 0alue. To reference an ele(ent fro( te
inco(ing XML "ata7 enter te +at to te XML ele(ent enclose" b& curl&
braces. !or e>a(+le3 MCrootC+asswor"O
#m(edding a Font Reference
!or tis e>a(+le7 su++ose &ou want to use a font in te te(+late calle" XML-*cri+t. Tis font is
not a0ailable as a regular font on &our ser0er7 terefore &ou (ust tell 8racle 42 -ubliser were
to fin" te font at run ti(e. You tell 8racle 42 -ubliser were to fin" te font b& setting te font
+ro+ert&. Assu(e te font is locate" in Ct(+Cfonts7 ten &ou woul" enter te following in te
-ro+erties "ialog bo>3
%ame3 >"o:font.XML-*cri+t.nor(al.nor(al
Type3 Te>t
Ealue3 truet&+e.Ct(+CfontsCXML-*cri+t.ttf
#en te te(+late is a++lie" to te XML "ata on te ser0er7 8racle 42 -ubliser will look for te
font in te Ct(+Cfonts "irector&. /ote tat if te te(+late is "e+lo&e" in (ulti+le locations7 &ou
(ust ensure tat te +at is 0ali" for eac location.
31
Ad'anced Re$ort La!outs
-atch reports
;ross:ta( support
5ynamic data columns
5efining columns to repeat across pages
%um(er and date formatting
;alendar and time ?one support
!sing e3ternal fonts
Advanced design options
Advanced 5esign ,ptions
2f &ou a0e (ore co(+le> "esign re?uire(ents7 8racle 42 -ubliser su++orts te use of X*L
an" X*L3!8 ele(ents7 an" as also e>ten"e" a set of *[L functions. RT! te(+lates offer
e>tre(el& +owerful la&out o+tions using 8racle 42 -ubliserHs s&nta>. 5owe0er7 because te
un"erl&ing tecnolog& is base" on o+en #3C stan"ar"s7 suc as X*L an" X-AT57 &ou are not
li(ite" b& te functionalit& "escribe" in tis course. You can full& utili6e te la&out an" "ata
(ani+ulation features a0ailable in tese tecnologies.
32

You might also like