Posts

Showing posts with the label XSLT Functions

Subscript , Superscript in BIP

How do i create a subscript and superscript in BIP ? we got use the fo element, inorder to display the element as sub or super <fo:inline baseline-shift="super" font-size="6px">2</fo:inline> <fo:inline baseline-shift="sub" font-size="6px">2</fo:inline> Just replace the number value 2 with element from XML. either using <?elementname?> or <xsl:value-of select="element_name"/>

Previous , next element ?

How to access the next element in the xml from the current context? Sometimes, we need the previous month node value, to compare with the current month value. Use XSL functions like following-sibling::, preceding-sibling:: <?for-each:/ROOT/ROW>? ================== Current StartDate <?START_DATE>? Current End Date <?END_DATE>? Next Start Date <?following-sibling::ROW/END_DATE>? Previous End Date <?preceding-sibling::ROW[1]/END_DATE>? ================ <?end for-each>? <ROOT> <ROW> <START_DATE>01-01-1980</START_DATE> <END_DATE>01-01-1988</END_DATE> </ROW> <ROW> <START_DATE>01-01-1988</START_DATE> <END_DATE>01-01-1990</END_DATE> </ROW> <ROW> <START_DATE>01-01-2000</START_DATE> <END_DATE>01-01-2005</END_DATE> </ROW> </ROOT> o/p ================== Current StartDate 01-01-1980 Current End Date 01-01-1988 Next Start Date 01-01-1990 Previous...

Limit rows per page

Image
Solution to have fixed number of rows in each page. This solution is not a perfect solution considering the line size increases due to text in each line. But this solution gives you how to fix no of rows per page. In the forum Heated discussion Users are arguing for having a placeholder in same fixed place on all pages, irrespective of no of lines , increased line size due to word-wrap. Here i am not going to discuss anything related to that. But a simple logic of , how to fix number of rows. Step 1: Loop through the records and display them Step 2: Have a condition for MOD of position(), then insert a page-break on the result of Zero Step 3. Blank row has to be filled, a condition has to be added, to find how many blank rows ROWLIMIT - (count of row mod ROWLIMIT) will gives us the rows to be filled. Step 4: use foreach_number function to simulate the iteration. Refer the images below

Xslt Functions continued

Image
here are few more function with samples...

XSLT extended functions

Image
We will look at the function which are available to us in BI Publisher. All the function should be begin with xdoxslt:{function_name} To start with , here are few.