Sie sind auf Seite 1von 15

Xml Publisher Additional Features Topic covered specifies that the group should begin a new section for

each record Page Breaks Split by group level or Regrouping Syntax Page !evel "alculations #isplaying Page $otals Sum Average "ount %inimum %aximum of the value for report wise #istinct "ount Function& "arry forward Page $otals Brought forward Page $otals Running Page $otals "ondition formatting and formatting trigger & XS! 'umber Formatting (xtended S)! and XS! Functions XS! (*uivalents +enerate "olor in Run $ime Formatting image Repeat $able ,eader in all pages in B-P #isplay -mages at runtime (lement Reference from X%! File Fixed row printing %atrix !ayout design +roup level matrix Page no

Specifies that the group should begin a new section for each record
$he statement affects the whole section including the header and footer. For example/ a for each0section context command creates a new section for each occurrence with restarted page numbering and header and footer. syntax& 1se in group tab 23for each0section&+4#(P$35 F P64'umber !ine 'o F !ine4'o ( -tem #escription -$(% (

Page Breaks
$o create a page break after the occurrence of a specific element use the 7split by page break7 alias. $his will cause the report output to insert a hard page break between every instance of a specific element. $o insert a page break between each occurrence of a group/ insert the 7split by page break7 form field within the group immediately before the 23end for each35 tag that closes the group. -n the ,elp $ext of this form field enter the syntax& 23split by page break&35 (mpno F (%P'6 (name ('A%( 8ob 86B %gr %+R ,iredate ,-R(#A $( Sal count SA! "omm max "6%% #eptno min #(P$' 6 PB (

Split by group level or Regrouping Syntax


Single level group + 23for each group&+4(%P'69.:#(P$'63523sort&#(P$'69;ascending;9data type<;text; #(P$'6 (mpno (name 8ob %gr ,iredate Sal "omm 23for ('A%( 86B %+R ,-R(#A$ SA! "6%% ( each&curren ( t group=>3 5F (%P'6 ( 23end for each group35 %ulti level group + #(P$'6 + 86B (mpno F (%P'6 ( (

(name ('A%(

%gr %+R

,iredate ,-R(#A$(

Sal SA!

"omm "6%% (

Group by and Order by Clause


23for each group&+4(%P'69.:#(P$'63523sort&#(P$'69;ascending;9data type<;text;35 + #(P$'6 (mpno (name 8ob %gr ,iredate Sal "omm F (%P'6 ('A%( 86B %+R ,-R(#A$ SA! "6%% (

(mpno (

(name

8ob

%gr

,iredate (

Sal

"omm

Page !evel Calculations "isplaying Page Totals


Sum of field value & 23('$4A%$3523add page total&(ntAmt9('$4A%$35 $o display the value 23show page total&(ntAmt97??+???+???#@@735

-nvoice (ntered Accounted "urrency Amount Amount 1S# A/@@@.@@ A/@@@.@@ (+ Page $otal& A@@@ A@@@

Su# $verage Count %ini#u# %axi#u# of the value for report wise
(mpno F (%P'6 count empno (name ('A%( 8ob 86B %gr %+R ,iredate ,-R(#A $( average SA! Sal SA! sum SA! "omm "6%% max "6%% #eptno #(P$' 6 ( min #(P$'

(mpno

(name

8ob

%gr

,iredate

Sal

"omm

#eptno 6

"istinct Count &unction'


23count=xdoxslt&distinct4values="6'$A"$4'A%(>>35

Carry forward Page Totals


23template&header35 2xdofo&inline total display condition<7exceptlast7 name<7(ntAmt75"arried Forward& 2xdofo&show carry forward name<7(ntAmt7 format<7??+???+???#@@7:52:xdofo&inline total5 23end template 35 use in footer tag

Brought forward Page Totals


23template&footer35 2xdofo&inline total display condition<7exceptfirst7 name<7(ntAmt75Brought Forward& 2xdofo&show brought forward name<7(ntAmt7 format<7??+???+???#@@7:52:xdofo&inline total5

23end template 35

Running Page Totals

R$otBar -nvoice 'umber +rp& -nvoiceACDDD D Form Field -novice Amount EA@@.@@ Syntax Running $otal EA@@.@@ #escription #eclares the 7R$otalBar7 variable and initialiFes it to @. Starts the -nvoice group. -nvoice 'umber tag

RtotalBar 23xdoxslt&set4variable=E4X#6"$X/ ;R$otalBar;/ @>35 F( A@@@A A 23for each&-'B6-"(35 23-'B'1%35

A 8an D@@G A@@.@@

23-'B#A$(35 23xdoxslt&set4variable=E4X#6"$X/ ;R$otalBar;/ xdoxslt&get4variable=E4X#6"$X/ ;R$otalBar;> H -'BA%$>35 xdoxslt&get4variable=E4X#6"$X/ ;R$otalBar;>35 23end for each35

-nvoice #ate tag Sets the value of R$otalBar to the current value plus the new -nvoice Amount. Retrieves the R$otalBar value for display. (nds the -'B6-"( group.

F(

"ondition formatting and formatting trigger &


B- Publisher supports the common programming construct 7if then else7. $his is extremely useful when you need to test a condition and conditionally show a result. For example& To define behavior when the ele#ent is present and the value is not null( use the following'

23if&element4nameI<35desired behavior 23end if35 $o define behavior when the element is present/ but is null/ use the following&

23if&element4name and element4name<735desired behavior 23end if35 $o define behavior when the element is not present/ use the following&

23if&not=element4name>35desired behavior 23end if35

XS! 'umber Formatting


$he native XS! format number function takes the basic format

Syntax& format number=number/format/JdecimalformatK> Parameter number format #escription Re*uired. Specifies the number to be formatted. Re*uired. Specifies the format pattern. 1se the following characters to specify the pattern& L =#enotes a digit. (xample& LLLL> @ =#enotes leading and following Feros. (xample& @@@@.@@> . =$he position of the decimal point (xample& LLL.LL> / =$he group separator for thousands. (xample& LLL/LLL.LL> M =#isplays the number as a percentage. (xample& LLM>

9 =Pattern separator. $he first pattern will be used for positive numbers and the second for negative numbers>

decimalforma 6ptional. For more information on the decimal format please consult any basic XS!$ manual. t

Record break into next page Select the $able property 5 +o to Row $ab5 1ncheck Allow row to break across page

(xtended S)! and XS! Functions


B- Publisher has extended a set of S)! and XS! functions for use in R$F templates. $he syntax for these extended functions is 23xdofx&expression35 DHC DC DNC D:C DNNC COOD 23xdofx&DHC35 23xdofx&D C35 23xdofx&DNC35 23xdofx&D:C35 23xdofx&DNNC35 23xdofx&COOD35 23xdofx&-'B4A%$H-'B4$AX35 23xdofx&FieldA FieldD35 23xdofx&FieldANFieldD35 23xdofx&FieldA:FieldD35 23xdofx&FieldANNFieldD35 23xdofx&FieldAOOFieldD35 Addition Subtraction %ultiplication #ivision (xponential "oncatenation

lpad=;aaa;/A@/;.;> rpad=;aaa;/A@/;.;> decode=;xxx;/;bbb;/;ccc;/;xxx;/;ddd;> -nstr=;abcabcabc;/;a;/D> substr=;abcdefg;/D/C> replace=name/;8ohn;/;8on;> to4number=;ADCPG;>

23xdofx&lpad=;aaa;/A@/;.;>35 23xdofx&rpad=;aaa;/A@/;.;>35 23xdofx&decode=;xxx;/;bbb;/;ccc;/;xxx;/;ddd;>35 23xdofx&-nstr=;abcabcabc;/;a;/D>35 23xdofx&substr=;abcdefg;/D/C>35 23xdofx&replace=name/;8ohn;/;8on;>35 23xdofx&to4number=;ADCPG;>35

23xdofx&lpad="6!4'A%(/A@/;.;>35 23xdofx&rpad="6!4'A%(/A@/;.;>35 23xdofx&decode="6!4'A%(/;bbb;/;ccc;/;xxx;/;ddd;>35 23xdofx&-nstr="6!4'A%(/;a;/D>35 23xdofx& substr ="6!4'A%(/;a;/D>35 23xdofx&replace=col4name/;8ohn;/;8on;>35

to4char=ADCPG> sysdate=> minimum maximum

23xdofx&to4char=ADCPG>35 23xdofx&sysdate=>35 23xdoxslt&minimum=(!(%('$4'A%(>35 23xdoxslt&maximum=(!(%('$4'A%(>35

XS! (*uivalents
$he following table lists the X%! Publisher simplified syntax with the XS! e*uivalents. Supported XS! (lements 2xsl&value of select< 7name75 2xsl&apply templates select<7name75 2xsl&copy of select<7name75 Placeholder syntax Applies a template rule to the current element;s child nodes. "reates a copy of the current node. #escription X%! Publisher Syntax 23name35 23apply&name35 23copy of&name35 23call&name35 23sort&name35 23for each&name35

2xsl&call template name<7name75 "alls a named template to be inserted into:applied to the current template. 2xsl&sort select<7name75 2xsl&for each select<7name75 2xsl&choose5 2xsl&when test<7exp75 2xsl&otherwise5 Sorts a group of data based on an element in the dataset. !oops through the rows of data of a group/ used to generate tabular output.

1sed in conQunction with when and otherwise to express multiple conditional 23choose35 tests. 1sed in conQunction with choose and otherwise to express multiple conditional tests 1sed in conQunction with choose and when to express multiple conditional 23when&expression3 5 23otherwise35

tests 2xsl&if test<7exp75 2xsl&template name<7name75 2xsl&variable name<7name75 2xsl&import href<7url75 2xsl&include href<7url75 2xsl&stylesheet xmlns&x<7url75 1sed for conditional formatting. $emplate declaration !ocal or global variable declaration -mport the contents of one stylesheet into another -nclude one stylesheet in another #efine the root element of a stylesheet 23if&expression35 23template&name35 23variable&name35 23import&url35 23include&url35 23namespace&x<url3 5

+enerate "olour in Run $ime Formatting image


http&::winrichman.blogspot.com:D@@R4@?4@A4archive.html ,ow to use this value and format the cell 3 2xsl&attribute xdofo&ctx<7block7name<7color752xsl&value of select<7"6!6R(!(%('$7 :52:xsl&attribute5 where "6!6R(!(%('$ is the xml element. what are the other formatting can be used 33 All XS! formatting can be used like this few samples are

2xsl&attribute xdofo&ctx<7block7 name<7background image75-mage.gif 2:xsl&attribute5 2xsl&attribute xdofo&ctx<7block7 name<7background position horiFontal75center2:xsl&attribute5 2xsl&attribute xdofo&ctx<7block7 name<7background position vertical75bottom2:xsl&attribute5 2xsl&attribute xdofo&ctx<7block7 name<7number columns spanned75D2:xsl&attribute5 2xsl&attribute xdofo&ctx<7block7 name<7font weight75bold2:xsl&attribute5 2xsl&attribute xdofo&ctx<7block7 name<7background color75rgb=DA@/A@G/C@>2:xsl&attribute5 "olor list SC colors 2xsl&attribute name < 7height7 xdofo&ctx<7block container75C@mm2:xsl&attribute5

Repeat $able ,eader in all pages in B-P


how to repeat the column titles on a table in all pages if the table extends over several pages Shat you need to is& A. Select and ,ighlight the table header row D. Right click and select table properties C. 6n the Row tab properties / specify that the header row should be repeated on every page P. Save the R$F G. B-P looks at the properties of the word settings for the table and will repeat the header row on every page the table needs.

$his works so well in P#F output/ but R$F output seeems to have some issue with this header repeat functionality Se all can beleive/ -n future releases this bug won;t be there 9>

Fixed row printing


!inesPerPageBariable !ines$reeBariable F( inv!ines #escription F(!ine #escription 16% 1o% )uantity 1nit Price BA$ M $otal 'et )uantity @.@@ @.@@ @.@@(F(

Page break9 (F(

%artix !ayout pdesign


%ore layout design refer & http&::winrichman.blogspot.com:search:label:crossMD@tab , 6-# Status +From $o +6# "oun t +??? & #FR & #$6( !ine $otal "oun )uantity t ( ??? ???(( 'et $otal 6-# "oun t ??? !ine "oun t ??? $otal )uantit y ???

+6-#4S$A$1S4#escri ption +roup matrix F Report $ype& type ,Plant +S1B-'B (

+#ay( !ines +???( 1nits +???((

$otal ??? ???

Bock ground color

Add new field & 23if&A""$#4A%$5A@@@352xsl&attribute xdofo&ctx<7block7 name<7background color75red2:xsl&attribute523end if35 6riginal field & r23 A""$#4A%$35 Bold format 23if&A""$#4A%$5A@@@352xsl&attribute xdofo&ctx<7block7 name<7font weight75bold2:xsl&attribute523end if35

Das könnte Ihnen auch gefallen