
In Bi Publisher , this is a very common requirement to set a variable in RTF template to do some data manipulation activities.
Set variable is used to declare the variable in the BI publisher reports. We need to declare the variable first and then initialize with some value. Set variable helps to Declare and initialize the value to the variable in the XML/BI publisher report.
Some examples are to set a Running Total in BIP , Count Records in a Group etc.
<?xdoxslt:set_variable($_XDOCTX, 'counter', 0)?>
<?xdoxslt:set_variable($_XDOCTX, 'lines_page', 4)?>
<?xdoxslt:set_variable($_XDOCTX, 'tot_lines', count(.//G_SLNO))?>
<?xdoxslt:set_variable($_XDOCTX,'remainder',0)?>
G_SLNO is the example group name.
xslt:get_variable($_XDOCTX, ‘lines_page’) <= 0?><?call:breaking?><?end if?><?end if?>
<?xdoxslt:set_variable($_XDOCTX, ‘counter’, 0)?>
xslt:get_variable($_XDOCTX, counter + <ColumnName>) <?end if?>
Column name is the field you want to have a running total.
We have detected that you are using extensions to block ads. This website runs on Ad revenue to manage the server hosting costs. Please help us by removing the ad blocker extension from your browser or use another browser that does not have Blockers.
Optionally if you have the option to whitelist https://wpsbutton.com in your blocker extension, please do.
Thankyou