1

We have an InfoPath 2007 form that populates a drop down from a SharePoint 2007 list of Employees. However, when opening the form in the browser (like it is designed to do) it does not alphabetize the drop down. But if i open the form on my computer, it does.

Anyone else come across this issue and have a solution to it?

I am wondering if it has to do with the indexing of the list, where if opened in the browser, if it sorts by the ID number that is assigned, where when on the computer it sorts by value.

Alex Angas
  • 59,219
  • 41
  • 137
  • 210
Brent
  • 121
  • 3
  • 16

2 Answers2

1

Instead of adding the List as a Data Source, add the Data View XML of the list as the data source.

You can locate the Data View XML of the list by using this URL:

<Site URL>/_vti_bin/owssvr.dll?Cmd=Display&List={<GUID of the List>}&XMLDATA=TRUE&SortField=<Internal name of the Field that you want to Sort>&SortDir=Asc

Use this XML file as the data source in your InfoPath form, the dropdowns will be sorted according to the field you have specified.

ashwnacharya
  • 14,601
  • 23
  • 89
  • 112
0

Looks like View-based sorting is not supported in browser-enabled form templates because it requires manual hand editing of the view XSL file Refer

Options you have are

  1. Hand edit the xsl
  2. Write custom code on the load event and sort it

For more tricks refer to this link

One good example that works like charm is here

Kusek
  • 5,384
  • 2
  • 25
  • 49
  • I tried editing the XSL but that doesn't appear to be working. I'll try the custom code next but i was really hoping for something more simple. Thanks though – Brent Jul 30 '09 at 17:12
  • 1
    Try the final Link that I have added, solution that is proposed in that article works and you do not need any custom code or editing of XSL. I tested it – Kusek Jul 30 '09 at 18:05
  • The problem with that is it is using a SharePoint 2003 list and not SharePoint 2007. When i try it, I keep getting errors stating url not valid. – Brent Jul 30 '09 at 19:56
  • Ok i found an answer and got it to work, although the only way it works is if i save the file to its resources (which then makes the drop down static and not dynamic). – Brent Jul 30 '09 at 20:12
  • SharePoint 07 answer can be found here http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/5527fa34-655d-4990-a45c-283c94484566 – Brent Jul 30 '09 at 20:13
  • Ok we figured out the problem. The URL works, however due to some Cluster issue, it only works when I try to open the form directly from the web server and not the Load Balancer. But other than this problem, your solution worked, thank you. – Brent Jul 31 '09 at 16:37