Welcome to Office Zealot Sign in | Join | Help

SPGridView - syntax error: missing operand after ‘X’ operator

I was building a custom SharePoint 2010 web part recently and was using the SPGridView to show results in a standard grid.  I wanted to add sorting and filtering on the grid (my next blog post will show coding details on this) and used the three lines below to enable filtering from the column headers:

grd.FilterDataFields = “,,Status,Type,,,,”;

grd.FilteredDataSourcePropertyName = “FilterExpression”;

grd.FilteredDataSourceProertyFormat = “{1} = ‘{0}’”;

The code worked fine until I changed the first line to enable an additional column:

grd.FilterDataFields = “,,,Status, Type, Part Vendor,,,”;

Then, I got the following error:

“syntax error: missing operand after Vendor operator”

Quick analysis led me to realize that the issue was the space between ‘Part’ and ‘Vendor’ in the field name.  I changed the third line to the following and all was good:

grd.FilteredDataSourceProertyFormat = “[{1}] = ‘{0}’”;

 

Posted by Mauro | 1 Comments
Filed under: ,

Change SharePoint 2010 Web Application Port Number

Recently, I had to move an existing SharePoint 2010 web application from the default port to a new port.  This is relatively easy to do but does require two steps.  The first is a change made in Central Administration; the second is done in IIS Manager.  Here are the steps I followed:

Step 1

In SharePoint Central Administration:

·         Click Application Management

·         Click Configure Alternate Access Mapping

·         Click the web application you are trying to alter

·         Change the port number by altering the URL; Save

Step 2

In IIS Manager:

·         Select the SharePoint site that corresponds with the web application above

·         Click Bindings…

·         Select the current port; click Edit; change the port number; Save

 

Copying a subset of documents from one SharePoint 2007 document library to another

Request

User wants an "easy" way to copy a subset of documents in a large document library to another document library; specifically, the subset is defined as all documents that meet specific metadata criteria (i.e. columns values meet certain conditions).  All metadata must move with the documents as well.

Problem

While SharePoint allows you to perform filtering on a document library, going in to explorer view (which can be used to move documents) ignores the filtering and always shows all documents

(One) Solution

Perform the following:

1. create a destination document library (no need to recreate metadata columns)

2. (have SharePoint administrator) go to http://TOPLEVELPATH/Reports%20List/AllItems.aspx (which is 'Content and Structure Reports')

3. click New -> New Item

4. give the report a name and set the CAML Query for your (column) filtering conditions; something like:
<Where><Eq><FieldRef Name="metatagexample"></FieldRef><Value Type="Text">a</Value></Eq></Where>

5. save the report

6. go to http://SITEPATH/_Layouts/sitemanager.aspx (which is 'Site Content and Structure')

7. select your new report from the list of Views (this should show the filtered list of documents)

8. select all documents (by clicking the checkbox in the upper left)

9. click Actions -> Copy then pick your destination document library

All documents will be copied and all metadata will be replicated as well!

Posted by Mauro | 0 Comments
Filed under: ,

"The form submission cannot be processed because it exceeded the maximum length allowed by the Web administrator"

You perform an stsadm -o export on a SharePoint site and then try to import that site using stsadm -o import into a different site collection.  Upon analyzing the import log file you notice several errors referring to "The form submission cannot be processed because it exceeded the maximum length allowed by the Web administrator."  The site import appears to have otherwise completed successfully.  What happened?

There is a Microsoft KB article (http://support.microsoft.com/kb/822059) associated with this error message.  It states that the error occurs when you try to upload a file that is greater in size than the allotted maximum for your SharePoint web application.  Bingo!  In this case, the original site was associated with a web application that allowed for greater file sizes (changed in Central Administration).  The new site (in a different web application) has a lower file size limit; thus, the import could not allow the bigger files to be imported.  The resolution is to change the file size limit for the destination environment and re-run the import.

Posted by Mauro | 0 Comments
Filed under: ,

“Additions to this Web site have been blocked”

Another day, another challenge in administering a SharePoint 2010 environment!  Here’s the scenario…

Service Pack 1 was applied to an RTM instance of a SharePoint 2010 environment.  The main site collection was behaving normally and was not recently restored prior to the application of SP1.  Upon the successful application, users noticed they could no longer add content.  Investigation showed the farm administrator could no longer edit permissions or add subsites.  All security definitions seemed to be in place and there were no policies defined that would alter security.  Heh?

Upon trying to change the site collection administrator (in Central Administration), the farm administrator received an “Additions to this Web site have been blocked” error message.  This message was actually a very good hint as we then immediately looked at the site quotes and locks.  Sure enough, the site collection was set to read-only!  No idea how this came to be but once we removed the lock all was good again.  Here’s how…

·         Go to Central Administration -> Application Management -> Configure Quotas and Locks

·         Set the Site Lock Information to "Not Lock" (it had been set to “Site Collection is set to Read-only (blocks additions, updates, and deletions)”

 

Posted by Mauro | 2 Comments
Filed under: ,
More Posts Next page »