Umer
Umer

Reputation: 137

BIP > Sorting is not working on BIP RTF template

I am trying to sort data in my BIP rtf template but it is not working. The report is being generated fine but the group 'Primary Focus' is not being sorted.

This is how report is being generated: https://www.dropbox.com/s/6zratu55hgf9o77/481539039485767out.pdf?dl=0

And this is how 'Primary Focus' needs to be sorted: https://www.dropbox.com/s/7pu2yb86iuccjuv/03.pdf?dl=0

Please find sample xml and rtf.

Rest everything is fine just 'Primary Focus' group is not being sorted.

Upvotes: 0

Views: 3761

Answers (1)

Ranjith R
Ranjith R

Reputation: 1589

Just move the sort code

<?sort:ssFocusTypePrimary;'ascending';data-type='text'?>

before the grouping code.

<?sort:ssFocusTypePrimary;'ascending';data-type='text'?><?for-each-group:current-group()[xdoxslt:format_date(ssReportedDate, 'yyyy-mm-dd','mm/dd/yyyy', $_XDOLOCALE, $_XDOTIMEZONE)>= (xdoxslt:format_date($StartDate, 'yyyy-mm-dd','mm/dd/yyyy', $_XDOLOCALE, $_XDOTIMEZONE)) and (xdoxslt:format_date(ssReportedDate, 'yyyy-mm-dd','mm/dd/yyyy', $_XDOLOCALE, $_XDOTIMEZONE))<= (xdoxslt:format_date($EndDate, 'yyyy-mm-dd','mm/dd/yyyy', $_XDOLOCALE, $_XDOTIMEZONE)) and starts-with(ssRohClinicFacilityName,$Clinic) and ssVisitType=$VisitType];./ssFocusTypePrimary?>[![enter image description here][1]][1]

enter image description here

Upvotes: 1

Related Questions