how to filter or search a value between a range in SharePoint 2010

Hi

I have a "Project" list library and a filed needs to specify the contract sum of that project. e.g 500000

I could also add another two columns as lowRange and HighRange e.g 100000 to 200000

So the list record would be

Project=ABC , lowRange=100000, HighRange=500000, ContractSum=500000
Project=CED, lowRane=500001, HighRange=1000000, ContractSum=750000

Project=EFG, lowRane=500001, HighRange=1000000, ContractSum=950000

When user filter or search a value 800000, CED and EFG list records will be shown

When user filter or search a value 250000, only ABC will shown..

Please advise what the best way to implement this ... ?!

Thanks

May 29th, 2015 10:18pm

Hi,

As I understand, you want to filter or search between two columns in the library in SharePoint 2010.

You could achieve it in the SharePoint designer. You could follow the steps below:

1. Open the list view in SharePoint designer.

2. Add a text box control on the AllItem.aspx page. The text box control will have an ID property with the value of TextBox1.

3. Right click on the text box control and choose Properties. Set the AutoPostBack to True.

4. Click inside the list view web part, and choose Parameters in the ribbon.

5. Add a new parameter called Param1. Set the parameter source to Control . Set the Control ID to TextBox1.

6. Then add a filter for the list view web part. Set the filter like this : lowRange less than Param1 and  HighRange greater than Param1.

7. This can achieve your requirement. But there is a problem: no items will show up when the text box is empty. The solution here is to add a data form web part on the page instead. In the data form web part, you can add xslt filtering like this :[@ lowRange >= $Param1 and @ HighRange <=$Param1 or string-length($Param1)=0]

For more detailed information, you could refer to the case below.

https://social.technet.microsoft.com/Forums/sharepoint/en-US/0cfbffcc-992e-4602-a7d1-8ba09801a5df/filter-sharepoint-list-value-based-on-calculation-of-two-other-fields-in-infopath-form

Best regards,

Sara Fan

Free Windows Admin Tool Kit Click here and download it now
June 1st, 2015 9:08pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics