.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

XsltListViewWebPart: Document Library with Content Types

Posted By:      Posted Date: September 12, 2010    Points: 0   Category :SharePoint
Good Morning, I have a requirement to add a webpart from a parent site to a child site to display a document library list view web part. Site structure eg: /parent/DocumentCenter /parent/ChildSite I have followed the instructions below as per http://social.technet.microsoft.com/Forums/en-US/sharepoint2010customization/thread/05c2c386-b6f3-4a4b-9641-e46d5bb3d4c2; 1) Open the parent site in SPD 2010.  2) Select "Lists and Libraries" from the left navigation pane 3) Select a list 4) In the "Views" section on the right, either open an existing view (e.g. AllItems.aspx) or create a new view. 5) In SPD page editor, click on the view. 6) In the Ribbon UI, go to List View Tools -> Web Part tab 7) Click "To Site Gallery" from "Save Web Part" section. 8) Give it a name and description (e.g. "ParentA") 9) Click "Yes" when the message pops up.  This ensures that the web part will point to the original source (i.e. main site) 10) In the browser, go to your subsite 11) Edit the page, insert web part through the browser ribbon. 12) Go to Miscellaneous section, and select the web part you saved. I have found if the document library is set to 'Allow Management of Content Types' the web part added to the child site will fail with the below error "Value does not fall within the expected range". As soon as i rem

View Complete Post

More Related Resource Links

MOSS 2007 Strange Problem with edit forms, content types and document library columns


I'm having a strange problem and have not been able to track down any useful answers over google.

I inherited a SharePoint site that I am now making some changes to.

I am having problems with one document library.  We had custom edit forms on this document library, which I was finding a pain to maintain so I reset them back to the site definition.  This edit form now shows only those fields that are associated with the Document content type (the only content type - I've deleted the others) on the document library.  There are other columns on this document library that are NOT associated with the content type that I would like to show on the edit form but they are not available when I try to add them to the content type via Settings > Document Content Type > Add from existing site or list columns.  The select columns from drop down is set to List Columns.  The Additional Authors column is just not there.

I CAN see this field on the all items view for the document library, it is there and populated with data.

Setting the Allow Managed content types radio button to NO does not have any impact on which fields are visible on the form- I still see those same fields that have been associated with the Document content type.

Has anyone else seen this or does anyone have any thoughts?? 

They will be muc

Files in document libary not picking up the correct content types

Hi, I have a document libary where I have 10 InfoPath content types attached. For eg: Type1, Type2 etc... Type10. In this doc lib, I have a folder for each cutomer, and inside each of those folders, I have a file of each Content type (".xml"). I am creating these Folders and files programatically. The problem is that, the files are not picking up its content types. Every file (.xml), when uploaded, its content type is "Document" which is the default content type. Earlier it used to pickup the correct content types. What could be wrong?

Files in document libary not picking up the correct content types

Hi, I have a document libary where I have 10 InfoPath content types attached. For eg: Type1, Type2 etc... Type10. In this doc lib, I have a folder for each cutomer, and inside each of those folders, I have a file of each Content type (".xml"). I am creating these Folders and files programatically. The problem is that, the files are not picking up its content types. Every file (.xml), when uploaded, its content type is "Document" which is the default content type. Earlier it used to pickup the correct content types. What could be wrong?

Content Query Web Part (CQWP) fails to show picture items from a document/picture library in an anon

I have a Picture Library and am trying to use the CQWP to display a list of items in the library.  The web part shows the items fine in authenticated mode, but it fails to show the items to anonymous users. The error log message is: Error while executing web part: System.NullReferenceException: Object reference not set to an instance of an object.     at Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart.SetDocumentIconUrlAndOnClickString(SPWeb web, DataRow row, String strDefaultItemOpen, Boolean fSetDocIcon, Boolean fSetOnClick, String fileRefColumnRef, String progIdColumnRef, String fsobjTypeColumnRef, String permMaskColumnRef)     at Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart.PreProcessForDocumentIconAndOnClickAttribute()     at Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart.AddContentQueryData()     at Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart.GetXPathNavigator(String viewPath)     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform) I'm running SP 2010.  I've tried various scenarios including: 1. Using the default publishing template. 2. Using the blank site template with publishing and lock down features enabled. 3. Us

How can I get search to work for a Custom Document Library with a few third-party field types?

Hi, Using WSS 3.0 with SQL Server 2008 for Workgroups I have created a Custom Document Library (2,462 files - copied from folder into Explorer view and then renamed using Batch Update in web services i.e. "BaseName" field) - basically it uses three fields that are of "Filtered Lookup" (a field type from a third party). The document library is included in the search (i.e. Advanced Settings), but it displays none of the files - bascially not included in search at all with all testing I have done. I created a new Document Library called "Test" and uploaded a document and it is included in the search. Is there any way I can debug this. Is there a log file? Is there something in the Search Database that might help? Your help would be really appreciated as this is my last issue - and its soooo important to the deliverable. Thanks. John.

SharePoint Programming: Replace content in documents of Document Library

HI, I have 100+ word documents in one of the document libraries on our SharePoint portal. Most of these documents contain HYPERLINKS which refer to a totally different SharePoint server. My task is to update all these HYPERLINKS to point to our server instead of external server. Any pointers on how to accomplish this would be highly appreciated. Thanks in advance Mahesh B

Make Document Content Types visible in search results

How do I make the document content type show in the search results? so when I search for something I get back the content type along with the usual title, summary, urls, size etc. thx    

URGENT: Document Library Content Type not inheriting some fields from parent Site Content Type


I have a situation that has foxed me!! I have a site level content type that has 8 fields... I use this to create more content types at the site level and use these in multiple Document Libraries (I have 40 doc libs).  This works fine for 38 of the libraries.  But for 2 of them... 2 of the columns are not showing up on the document libraries.  These are user lookups fields.  I am not sure why it's not working in these libraries only!  When I use the same content type in another library... the inheritance does not break for these fields!

Anyone please provide some guidance on this?  I am using WSS 3.0 and SPD to do workflows.

On another note... the content type has a template (in excel) attached to it.  When I create the content manually using the content type from the New menu option, the template is used... however, when I try to add it using an SPD workflow, it creates a blank template... the content type template is not being used.

Please help... I am in a fix and need to release this application today!!!

Move Document Library Content From One Site To Other Site


Dear All,

                I have nearly 4 GB of document uploaded in one of my Document Library in my MOSS 2007 site. Now we have created other new Site in Moss 2007. Now i need to move this 4gb content to the newly created site. is there any workarounf for this

Site one something like http://sharepointsite:80

so i wanted to move content from 80 to 85

Note : I have many subsite in 80 site... i just wanted to move one particular Document Library to 85 site Document Library


Thanks in Advance

Narayanan Dayalan --------

Cannot Use Excel Spreadsheet (xlsx) as Template for Content Types or Document Libraries


I have created a document library, specifying that the 'Microsoft Excel Spreadsheet' be used as the document template.  When I try to create a new document by selecting the template from the 'new Document' drop down, I get a message stating that 'The document could not be created.  The required application may not be installed properly, or the template for this document library cannot be opened.' Additionally, the template is opened as template[1].xltx in notepad (with all of the funny characters you would expect).

I have Office Professional Plus 2010 installed on my computer, and I am able to open XLSX and XLTX files from SharePoint (just not from the 'new document' button).  I also have no problem with PowerPoint or Word templates in SharePoint. I am also able to open the excel template by navigating to the template in explorer view.  I've found that if I open Excel before I attempt to create a new document, the template will open in Excel, however the document is titled 'Template1' instead of 'Document1' as would be expected.  Any thoughts?

Adding New Custom Folder Content Type doesn't show up on the Document Library New Menu


I been trying to add new custom folder content type to the document library programatically in my sandbox environment and it does show up on the document library. But, when I move same code to the almost similar configured SP2010 environment, adding new folder content type to the document library doesn't show up on the document library's new menu.

Here is the code? Since this code works fine in my sandbox environment, is there any other settings I should check on the server environment which would cause hiding content type on new menu of document library.

  class Program
    static void Main(string[] args)
      SPSite spSite = new SPSite("http://sp2010vm");
      foreach (SPWeb spWeb in spSite.AllWebs)
        spWeb.AllowUnsafeUpdates = true;

        //For each site, cycle through lists
        bool isDocLibraryExists = false;
	      foreach(SPList spList in spWeb.Lists)
          if(spList.Title == "Classified Documents")
             isDocLibraryExists = true; 
        if(isDocLibraryExists == true)
          //Create new doc library
          SPList splist = spWeb.Lists["Classified Documents"];

          //Create Content Type
          SPContentType documentContentType = spWeb.AvailableContentTypes["Classified Documents Folder"

Moving Document Libraries with Content Types & Metadata


Hello All,

Was hoping someone could give me some guidance on this issue.  I have been working on a document management strategy for my department's sharepoint site which consists of numerous document libraries configured to a number of content types..  Lots of metadata and views.. etc

Recently, the IT department in our organization has started work on a green slate installation of Sharepoint.. new server, fresh install, master pages, site hierarchy, the works..  

Guess my question is, how hard is it going to be to migrate my document libraries  while keeping my metadata and content types intact?  I probably have about 21 content types and almost 10 Gigs of data to transfer over... not sure what the best approach is having all this content migrated over to the new portal.

I have done some research and either only find articles on moving content types or moving document libraries, but no articles on moving both and having the content types map to the document libraries while keeping the metadata.

Any help or guidance would be appreciated.


External Data Fields in a Word Template saved as a content type in a document library with multiple


I have created a Word Template for a Document Library that has an External Data Column in it of Client Name which also adds Client Address1, Client Address2, Client City, Client State, & Client Zip.  Now this works fine for a Document library with that template as the Template.dotx file. 

I want to be able to make a bunch of Templates and have them all as Content Types in one Library.  When I do this I cannot get the External Data Quick Parts to work.

Anyone have any ideas?

Save text box content as a text file in sharepoint 2010 document library


I am a sharepoint developer and currently I am trying to save content of a text box from client side in document library in share point 2010. I have created a sandbox solution for this. I explored the SP2010 client side object model for ECMA script, however I was not able to crack the problem.

I have created the byte array from the text box content and now I want to save it as a text file in the document library using ECMA script.

Kindly suggest how can I achieve that.

Custom document library list template issues with custom content type


Either I don't know what SharePoint is doing or I don't know what I'm doing (or both, which is more likely).

I'm attempting to create a Custom Document Library template with a custom content type association (Custom Document), all using a feature. When I create
a document library based on the installed template, the content type association is there. However, when I click on New Custom Document, the template.dotx does not reflect the Custom Document content type association. The Word document information panel does not show any Custom Document content type properties (like Title and Comments).

Here are the steps I've taken:

1. Create the feature.xml with element manifests of contentType.xml and CustomDocumentLibrary.xml
2. Create the contentType.xml (Custom Document) with an additional field reference for Comments
3. Create the CustomDocumentLibrary.xml for the list template
4. Create a Custom Document Library subfolder that contains the same files that are in the 12\TEMPLATE\FEATURES\DocumentLibrary\doclib folder.
5. Edit the schema.xml to use the new content type and field reference
6. Deploy and activate the feature
7. Create a new "Custom Document Library"
8. Go to Custom Document Library Settings and verify the Custom Document content type is being used
9. Click on New Custom D

SharePoint Library alerts not received when documents are of certain content types


I have set alerts to notify me when a new doc is added. The alerts are receive for documents of generic content types, but when custom content types are used, then the alerts are not received. Does anyone have any solution/advice?


Site Admin Can't Delete Content In Document Library



I am the admin of a site and need to delete a version of a document someone else uploaded into a document library. In other libraries, when I hover over the document, I get the drop-down which contains the "Edit Item, Open In... and Delete". In the particular library, I don't get that menu. Any ideas why?


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend