Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Specify sortorder in Summary Report


This topic is 7255 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I would like to have a Summary Report sort by school year Month. So, I have a value list set up with August, September, October, etc

In the XSL for my Summary Report, I have the following lines generated from the Site Assistant.

xsl:comment>Display records in the current group-by section

xsl:for-each select="fmrs:resultset/fmrs:record[generate-id(.) = generate-id(key('_records-group-key', fmrs:field[@name=$_groupby-field-name]/fmrs:data)[1])]">

xsl:sort select="fmrs:field[@name=$_groupby-field-name]/fmrs:data[1]"/>

xsl:variable name="_records-group" select="key('_records-group-key', fmrs:field[@name=$_groupby-field-name]/fmrs:data[1])"/>

xsl:variable name="_records-group-count" select="count($_records-group)"/>

xsl:for-each select="$_records-group">

xsl:sort select="fmrs:field[@name=$_groupby-field-name]/fmrs:data[1]"/>

xsl:variable name="_record" select="."/>

Based on this, the Month (_groupby-field-name) is being sorted alphabetically. What line can I add to make the sortorder set by my valuelist?

thanks,

[email protected]

  • 4 weeks later...
Posted

Difficult question. Well, I don't see an answer in case of a general value list for the moment. But in your case, where you might have a regular order of month(-numbers), you might try that: What, if you add a field month_numeric with values 1,2,3,...12 corresponding to each of your months to the database (e.g. as a calculation field).

Then, in the XSLT file, replace in the variable definition for _groupby-field-name Month by month_numeric, and add the attribute data-type="number" to each <xsl:sort select=...>

Martin

P.S. Good FAQ for general XSLT problems is here: XSLT FAQ - Sorting

This topic is 7255 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.