Solved

Data View Filter Errors and XSLT fail

Posted on 2011-09-13
1
482 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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Summary In SharePoint 2010 it is easy to create custom color themes to jazz up a site. Theme colors can also be created in PowerPoint 2010 with a few clicks. But how do the chosen colors actually look in the SharePoint site? The attached PowerPoint…
SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 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

14 Experts available now in Live!

Get 1:1 Help Now