Monday, July 30, 2012

Using PowerShell to downgrade a SharePoint v4 site to v3


Use the following powershell commands on a SharePoint front end server to downgrade a v4 site to v3.

$Web=Get-SPWeb http://<site name>/<site>
$Web.UIVersion=3
$Web.UIVersionConfigurationEnabled=$true
$Web.update()

Wednesday, July 18, 2012

Using the Eval method in a SharePoint master or layout page

Examples of using Eval method in SharePoint master or layout page:


In this example "Include Time" is a SP yes/no field where we're checking for a value of "yes":



<%# Eval("Include Time").ToString() == "True" ? " (" + Eval("Start Time","{0:hh:mm tt}") + ")" : "" %>



In this example "Active" is a SP yes/no field where it's casted to a boolean value and then used to control visibility of an asp:Label control:



Visible='<%# bool.Parse(Eval("Active").ToString()) %>'

Another example of setting the Visible property. If the value of Descrition is null, hide the control:

Visible='<%# bool.Parse(Eval("Description") == null ? "False" : "True") %>'

Tuesday, July 10, 2012

SubjectsAll dynamic prompt for Crystal


The prompt group 'RDS SubjAll M' in Crystal Reports requires logic in the Record Selection formula to account for the ' All' value for all subjects. Below is an example of how to construct the query:

if ({?Subject} <> " All") then 
({?Subject} = {RDS_CLASS_VW.CLASS_SUBJECT_CD} and
{?Institution} = {RDS_CLASS_VW.CLASS_INSTITUTION_CD})
else
{?Institution} = {RDS_CLASS_VW.CLASS_INSTITUTION_CD}

If the Subject parameter equals ' All' we simply ignore it.

Monday, July 9, 2012

Removing annoying checkboxes in a List web part

When I add a List web part to a page, I'm left with a bunch of annoying check boxes in front of each item, as shown below:










To get rid of these, since they don't really serve any purpose on our public pages, I've added a content editor web part to the page with the following css code. Make sure you add the code using the source editor:

<style type="text/css">
TH.ms-vh-icon {
DISPLAY: none
}
.ms-vb-itmcbx {
DISPLAY: none
}
</style>

I then get a cleaner look to the listing with the check boxes removed from the page.