.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Dataview filter

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :SharePoint
Hi ALL ,

I have tried the XSLT for random display.
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[@ID=(substring(ddwrt:FormatDateTime(ddwrt:TodayIso(),1033,':mm:ss'),6,2) mod count(//Rows/Row))+1]"/>

In the designer when I refresh the data source it displays correctly ie it rotates between all items in the list.
But when i view in the browser it picks from first 10 items in the list for display, its failed to pick above 10.

So it rotates within 10 items.

Can anyone help me out


View Complete Post

More Related Resource Links

Filter DataView by Value from Active Directory

I have a web part page with a dataview that is configured to display as a single item form.  The list that the dataview is pulling from will include many items, I just want to display the one item that is related to the current user so that I can populate some of the fields via javascript. The catch is, I need to match on a value in Active Directory other than logon name, username etc.  We are using a field in Active Directory to track Employee ID which is the unique ID that is used by our Finance/HR system.  I am able to use to the SPSWC:profilepropertyvalue control to display the Employee ID, I just cannot figure out how to pass that value to the dataview as a parameter to filter on. I don't have the option of a query string parameter because this is the first page the user will come to in this scenario.  I have tried both the Control and Form types of parameter but the value is never passed.  I currently have the SPSWC:profilepropertyvalue control in a div tag (I thought that if I gave the tag an ID I could reference it that way), but so far I've had no luck.  I have also tried using Javascript to take the value from the control within the div tag and assign it to a textbox, but I still cannot get the value to pass to the dataview. Here is the code for the SPSWC:profilepropertyvalue control: <table> <tr><td> <SP

Passing a Text Value as DataView Filter Parameter

I have a dataview to which I would like to pass a text value for use as a filter.  My text value is on the same page within a DIV tag that I have given an ID.  When I view the page in the browser the text is actually rendered in a SPAN tag, within the DIV tag.  I have tried the ID for both the DIV and SPAN tags when setting up the parameter, and have tried using both a parameter type of Control and Form, but nothing I've tried is working. Any thoughts?  Thanks, Chanda

Filter and Sort on fields in a joined dataview in SharePoint Designer


I need to create a data view that joins and displays data from two lists, and to sort and group on all of the fields displayed, not just fields from the main list.

I created linked datasource from two of my lists, joined them on a common field, and first inserted fields from the main list. Then I inserted fields from the other list as a Joined Subview,  which worked just fine, but now I need to be able to sort and filter on fields in that joined list, for which there doesn't seem to be an option.

Does anybody know whether it's possible and/or any workarounds/solutions for this? Basically, Is there a way to create a joined view of two lists where all fields are displayed in separate columns, and not in a table within a cell as in a case with joined subview?

Any comments are highly appreciated.


Dataview filter on querystring parameters - how to return all when empty?




I'm creating a page with a dataview wepart. The dataview is filtered by three querystring parameters. This works fine as long as all parameters are present in the querystring. The parameters currently all have defaultvalue set to "". If one parameter is missing from the querystring, the dataview returns no results (no column values matches "" they all have values). I would like it to return all results if the parameter is not present, does anyone know how to do this?


The dataview is displaying items in a Sharepoint list and currently the filter uses "equals" because I'm filtering on a MultipleLookup field type. 


I would really like to see a wildcard character in CAML like I can use % when I do this for a dataview with a sql server datasource.





DataView external datasource filter large dataset?


Basically, I have combined 3 call logs from verizon (comma-delimited), t-mobile (comma-delimited), and a internal system (SQL Server) into one table.  Built a dataview to a table that right now with test data has 300,000 rows and will have lots and lots more and all fields are varchar() in database even date and time.  Since I have 300,000 rows, I paged the data at 1000 as this would take a long time for everything to load.

So building the dataview was a challenge to get working but figured that out.  Now I am trying to build searching functions so that someone can search and filter the results on date, time, and really any of the fields.  I attempted a form webpart and setup parameter for search and it kinda works when I have a few test rows. One thing I noticed was if the data was on another page it did not include those in my filter and I think if I paged over eventually I would find it.

So my ultimate question is how would I add filtering/searching into this dataview.  Could I dynamically adjust the query for the dataview like on said date range based on dates in form web part?  Is there a better method for anything I am trying todo?

Thanks, Matt

Using jQuery to Filter Table Rows

The project is using the .net GridView control, so I had limited control over the output HTML code. Still, I think this code can work for most tables. One thing to notice: you should use the class "filterable" on your table or on one of its parents for the code to work.
First, we need a text box:

GridView Multiple Filter AJAX Control

This AJAX control enables the user to filter data within any column inside a GridView. The user can add multiple filters and can delete existing ones too.

Where to Filter the companies returned by the EF?



I am just starting with dynamic data. I have an enttity framework called UsersModel.edmx.

It returns a list of all companies in the tblCompany table. This list is really big.

I need to filter the list returned to all user controls on the client so that it only returns the company that have a CompanyTypeId= 2 or CompanyTypeId= 3 and company name != "".

1 - Is it possible to filter the company list returned on the server so that I can filter only once for all the controls that use that on the client?

My ideas was to do something like this using linq and lambda but I am not sure how:

return tblCompanys.Where(c => c.CompanyTypeId == 2 || c.CompanyTypeId == 3 && ).Where(c=>c.CompanyName != "").OrderBy(c => c.CompanyName).Distinct().OrderBy(c=>c.CompanyName);

2 - I have created a partial class and a metadata class and added the DisplayColumn attribute to use the company name and sort by company name ascending.

Could I use the code to filter the returned companies in this? where?

namespace MarsMedicalModel
    [DisplayColumn("CompanyName", "CompanyName")]
    public partial class t

Filter by Computed Column



After looking for a driver to open legacy dbf drivers to connect, the next level trouble a have is this one:

first, i can retrieve the data but when trying to filter by a parameter (somesc columns) i get an error.

The error says about the database can't determine some blah blah!

The error is a columm tha is formated (  1234  ) about  8 space, fixed. The values in the query appears like that. I resolve this by Trimming Ltrim(ColumnName) and i get this (1234).

Now in SqlExpress, how can i filter by the new Trimmed Expression? (This is a primary key that the DBF use)


SELECT column1, column2, column3


SELECT Ltrim(column1) as NewExp, column2, column3
Where NewExpre = @NewExpres                  -Error-


LDAP nested groups filter


Hi all,

In my organization we use nested groups.

For a particular usage, we have a group (let's assume that the group name "kuku"), and the names of all the nested groups under it contains "kuku" as well.

We may assume that no other group in the LDAP has "kuku" in the name.

I need to create a filter which will return all the users which belong to one of the "kuku"s group.

Obviously, using this filter will bring only the head kukus

(&(&(objectclass=user)(objectclass=person))(memberOf=CN=kuku,cn=.rest of the group DN.))

How can I use wild card to fetch all users which belong to any kuku?

For example: (&(&(objectclass=user)(objectclass=person))(memberOf=CN=.*kuku.*))



Urgently Need Help : Unrecognized Tag Prefix or device filter 'CR'


I have download and installed the Crystal Report for 2010 from my Visual Studio 2010. 


Problem 1 :

When I create a new crystal report in the Project, the aspx created code below :

<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server"
            AutoDataBind="True" GroupTreeImagesFolderUrl="" Height="1202px"
            ReportSourceID="MemberList" ToolbarImagesFolderUrl="" ToolPanelWidth="200px"
            Width="1104px" />
        <CR:CrystalReportSource ID="MemberList" runat="server">
            <report filename="MemberList.rpt">

 but there is error : unrecognized tag prefix or device filter 'CR'


Problem 2 :

The vb code of the crystal report that I had created has 'ComponentModel is not a member of 'MYPROJECT.system'



Data Points: SqlConnectionStringBuilder, DataView, and More


Several significant enhancements have been made to ADO. NET 2. 0 in the areas of improved performance, increased flexibility, and added features. In my last column (Data Points: DataSet and DataTable in ADO.

John Papa

MSDN Magazine January 2006

ISA Server 2004: Developing an Application Filter for Microsoft Internet Security and Acceleration S


The beta version of Internet Security and Acceleration (ISA) Server 2004 is now publicly available. It includes a rich SDK with several extensibility mechanisms that allow third parties to integrate their specialized solutions on top of the ISA platform. In this article, the author explores the application filter extensibility mechanism, which enables you to add high-level application layer filtering capabilities to ISA Server and to provide rich content filtering solutions. He also highlights the new features of the ISA Server 2004 SDK, then moves on to describe how to develop a basic application filter that monitors all data going through the ISA Server, and how to integrate a filter into the ISA Server management console to create a seamless interface experience for your users.

Yigal Edery

MSDN Magazine March 2004

ISAPI Filters: Designing SiteSentry, an Anti-Scraping Filter for IIS


The Microsoft Internet API for IIS, ISAPI, sits between the client and the Web server. Therefore, you can access the HTTP data stream before IIS gets to see it. The project in this article takes advantage of the ISAPI architecture to create a filter that monitors access to a Web site to determine if visits are from typical users or from automated processes designed to pilfer information from your site. The author tracks the regularity of visits to the site to determine the likely source. Once the determination is made, the app either redirects the user or continues to track information about those hits.

Rodney Bennett

MSDN Magazine October 2001

MVC 3 Preview 1. Inject value in Action Filter



I was reading MVC3 Preview 1 release and I found this:

Dependency Injection at all levels - We opened up seams for applying the dependency injection when instantiating components of the framework. This allows developers to hook into the creation of models during model binding, action filters, etc.

Does that mean I can inject a value into an Action Filter?

This is a problem I have for a long time and it would be really useful.

How can I do this?



MVC3: Define Dynamic ViewModel property inside Action Filter



How can I define a Dynamic ViewModel property in MVC 3 inside an action filter?

I am looking to have something like but inside the ActionFilter and not in the controller:

ViewModel.Title = "Home";

Thank You,


filter n compare between two table in resultset


Hi .. I have two table 

Say Table1 n Table2


Item              ItemName

001                 Laptop

001                  PC

002                  PC

002                  Printer

003                  Pendrive

004                  Keyboard

004                  CPU


Item                  ItemName

001                   laptop

001                   PC

002                   Printer

004                   CPU

Here am comparing table1 with table2

The Itemname which is available in both table1 n table2 should be dropout ... Other Item should be displayed ...

I need the sql result set like this :

Item                 &n

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend