Content Rating Part III-adding a customized sort expression

 
In the case of the content rating site template I wanted to sort the list by rating with the highest rated items rolling to the top:
 
Here is the expression I used:

format-number(sum(../../../Content_Ratings/Rows/Row[@BPID=@ID]/@Rating)div (@Ratings), ‘###0.0;-###0.0’)

 
Notice it’s similiar to the rating expression itself.  pretty cool.
 
To do your own you can add directly to your DVWP’s sort/grouping.
 

Go to your DVWP, select sort and group, remove any prior sort expressions, add a new custom sort expression using the handy x-path editor (hand tweak as necessary for you own needs) and whaaa laaa-

 
Rod.
Advertisements

4 thoughts on “Content Rating Part III-adding a customized sort expression

  1. Hi Rod,
     
    I went through your posting "Implementing Content Ratings for Sharepoint via SP Designer-Part II Step by Step".
     
    Its very nice, I am facing some problem while deploying that particular XSLT view from development server to Testing/Production server.
     
    Please help/suggest me, how we can deploy these XSLT views to Testing/Production Server.
     
    Thank You.
     

  2. Hey, I think I sent in email awhile back right?  Customizing DVWPs and such in SP Designer and packaging up as a site template is one way.  This works fine if you can over-write the entire site or create new ones for test/UAT is an option.  If you are going to be developing and deploying web parts in a traditional software development methodology and deployment process and have access to the server environments then you should consider developing this web-part in Visual Studio/C# and deploying as either a site feature or dropping the assembly files and artifacts as part of a deployment process.  I recommend using the smart-part template for simplying developing the web part in VS.  Check out MSDN for tons of info on web part development in MOSS 2007/WSS 3.0.  For deployment scenarios you might want to quickly read Team Based Development on MOSS 2007…  Search the web for smart part info-it\’s out there in spades. 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s