While it isn't a built-in function, the "Asset Tracking" sample form provides
a JScript+XPath implementation for sorting fields by column.
> Infopath is great for creating and sharing forms, but the one things it lacks
> is the ability to sort data by column(s). This feature would give Infopath
[quoted text clipped - 8 lines]
>
> http://www.microsoft.com/office/community/en-us/default.mspx?mid=1e87873c-b248-4
cbf-ad21-130c81b119a9&dg=microsoft.public.infopath