Solved

Data View Filter Errors and XSLT fail

Posted on 2011-09-13
1
484 Views
Last Modified: 2012-08-13
Getting a "non-specific error" that I can't seem to get rid of. I can provide code samples later, if need be, but here's my setup:

- 2 date entry web parts (one for start date, one for end date)
- 2 data view web parts. Both data view web parts point to the same list as a data source.
- Both data view web parts use the date entry web parts as filters (via SelectCommand in the DVWP).
- Both DVWPs have the following additional XSLT filter (note that "Product" is different between each DVWP, and my syntax may be off since I'm doing this from memory: [not (@Teacher = following-sibling::@Teacher) and (@Product = 'Product')]

The requirement is to have a big list of visits to teachers, all on different dates, with different products involved (sometimes different products to the same teacher on different dates). The DVWP are designed to show the most recent visit for each teacher for the matching products. In a case where you have a bunch of visits for each teacher, they could potentially show in both DVWPs, with only their most recent visit for that product being displayed in each data view (so they would display twice).

When I had one DVWP, it worked fine with no issues. However, when I added the second DVWP, things started to go screwy. Only the DVWP representing the product where the most recent visit occurred displayed a record, even though the teacher had records for both products (so they should have displayed in both DVWPs).

I've tried editing the SelectCommand, but every single time I get a non-specific error when I change it even a little. I'm also getting the same issue if I mess with the XSLT filter. It's like I can't make any changes to my code without it breaking. The only thing that seems to work is to completely remove the date filter parameters from both DVWPs, and then both display the expected data (why does this work?). However, the date filters are important for user experience, so they can report on visits just within a specific date range.

I even tried starting over from scratch with two brand new DVWPs, both pointed to the date filters, and got the same end result.

So, I'm not exactly sure what's going on. My current theories are:
- Hooking the date filters up to both DVWPs is causing some sort of interference, so I need to create a separate set of date filters for the 2nd DVWP
- ?
0
Comment
Question by:drakmon
1 Comment
 

Accepted Solution

by:
drakmon earned 0 total points
ID: 36533475
Alright, so here's how I fixed it:

- Recreated both DVWPs
- Added basic filters
- Added Parameters
- Added Parameter-based filters
- Established web part connections

...and save/tested after every single change.

Works perfectly now! :D

Note to self: Never, ever use SP Designer again for anything but page layout. It blows up my code every time I use the interface to change the filtering.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note:  There are two main ways to deploy InfoPath forms:  Server-side and directly through the SharePoint site.  Deploying a server-side InfoPath form means the form is approved by the Administrator, thus allowing greater functionality in the form. …
The Scenario: Let’s say you have a quote worksheet in Excel that you use to work up sales figures and such for your clients. You utilize SharePoint to manage and keep track of these documents. You would like values from your worksheet to populate Sh…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now