Thursday, December 8, 2011

Office Webapp issue with Sharepoint 2010

Word Web App cannot open this document due to an unknown error. If the problem persists, try opening the file in Microsoft Word.

Tested by nidovan


After the SharePoint administrator has installed, configured, and activated Office Web Apps, end users might receive an error message when they try to view or edit Microsoft Word, Microsoft Excel, Microsoft PowerPoint, or Microsoft OneNote documents in the browser.


These errors might occur for one or more of the following reasons: (Microsoft recommendations)

  • The SharePoint administrator has run Office Web Apps Setup, which configures the default open behavior for SharePoint to open Microsoft Word, Excel, PowerPoint, and OneNote documents in the browser by using their associated Web application. However, the SharePoint administrator has not yet started the services, created the service applications, and activated the Office Web Apps feature.
  • The Office Web Apps services are not started on the Web front-end server.
  • The Office Web Apps service applications and proxies have not been created.
  • The Office Web Apps service applications proxies are not associated with the proxy group of the Web application that the site collection belongs to.
  • There might be a problem with the permissions for the service account that is used to run the Web application or one of the Office Web Apps services: Excel Calculation Services, PowerPoint Service, or Word Viewing Service. The Web application and service applications must have the appropriate permissions to access the content databases and the configuration database.
Resolution:

  • The SharePoint administrator can avoid end users' seeing error messages while he or she finishes additional deployment tasks to deploy Office Web Apps on a live production server. We recommended that you enable the OpenInClient feature on existing site collections before you run Setup.

  • Activate the Office Web Apps feature for the site collection. For information about how to activate the Office Web Apps feature for a site collection.
    How to verify that the services has been properly created or not / How to check the status of the services on the servers in the farm:


  • On the Central Administration Web site, in Application Management, click Manage services on server.

  • On the Services on Server page, do the following:
    1. In the list of services on the selected server, verify that Excel Calculation Services, PowerPoint Service, and Word Viewing Service exist and are started. If a service is not started, click Start.
    2. Click the Server button at the top, click Change Server, and then in the Select Server dialog box, click a different server name.
    3. Repeat these steps until you have verified that the services exist and are started on all servers in the farm.
    Verify that the Office Web Apps service applications and proxies have been created by doing the following:
    1. On the Central Administration Web site, in Application Management, click Manage service applications.
    2. On the Manage Service Applications page, verify that there the following kinds of service applications exist:
      • Excel Services Application Web service application
      • PowerPoint service application
      • Word Viewing service application
    Verify that the Office Web Apps service applications and proxies are associated with the proxy group of the Web application that the site collection belongs to by doing the following:
    1. On the Central Administration Web site, in Application Management, click Manage web applications.
    2. On the Web Applications Management page, select the Web applications that the site collection belongs to, and then clickService Connections.
    3. On the Configure Service Application Associations page, verify that the following kinds of service application proxies are associated with the Web application:
      • Excel Services Application Web service application proxy
      • PowerPoint service application proxy
      • Word Viewing service application proxy
    If you have any queries/questions regarding the above mentioned information then please let me know...I would be more than HAPPY to HELP you as well as RESOLVES your issues, Thanks again :-)

  • Wednesday, December 7, 2011

    Chrome issue with sharepoint navigation - Browser selection

    Add the following to the masterpage:

    <script type="text/javascript">
    $(document).ready(function() {

    var userAgent = navigator.userAgent.toLowerCase();
    $.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase());   // Is this a version of Chrome?
    if($.browser.chrome){
     $(".Fanr-tn ul.dynamic").hide();
     $(".Fanr-tn li.static").hover(
            function ()
            {
              var leftv = $(this).css("left");
              var rightv = $(this).css("right");
              $(this).children("ul.dynamic").show();
              $(this).children("ul.dynamic").removeClass("hide-sub-menu");
              $(this).children("ul.dynamic").css("left",leftv);
            //  $(this).children("ul.dynamic").css("left",rightv+20);
              $(this).children("ul.dynamic").addClass("show-sub-menu")
             
            },
           
            function ()
            {
             // $(this).children("ul.dynamic").show();
              $(this).children("ul.dynamic").removeClass("show-sub-menu");
              $(this).children("ul.dynamic").addClass("hide-sub-menu")
            }
            );//hover
           
           
            $(".Fanr-tn ul.dynamic li.dynamic-children").hover(
            function ()
            {
              var leftv = $(this).css("left");
              var topv = $(this).css("top");
              $(this).children("ul.dynamic").show();
              $(this).children("ul.dynamic").removeClass("hide-sub-menu");
              $(this).children("ul.dynamic").css("left",leftv);
            //  $(this).children("ul.dynamic").css("top","-=1");
            //  $(this).children("ul.dynamic").css("left",rightv+20);
              $(this).children("ul.dynamic").addClass("show-sub-sub-menu")
             
            },
           
            function ()
            {
             // $(this).children("ul.dynamic").show();
              $(this).children("ul.dynamic").removeClass("show-sub-sub-menu");
              $(this).children("ul.dynamic").addClass("hide-sub-menu")
            }
            );//hover

    }
           
    });// document ready
    </script>

    Saturday, October 15, 2011

    Search Masterpage

    Search masterpage require the following tags:

    <asp:ContentPlaceHolder ID="PlaceHolderTitleBreadcrumb" runat="server"></asp:ContentPlaceHolder>



    Note:

    Place this tag above the
    <asp:ContentPlaceHolder id="PlaceHolderMain" runat="server" />


    Remove
    <asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server">
    <SharePoint:ListSiteMapPath
       runat="server"
             SiteMapProviders="CurrentNavigation"
             RenderCurrentNodeAsLink="false"
             PathSeparator=""
             CssClass="s4-breadcrumb"
             NodeStyle-CssClass="s4-breadcrumbNode"
             CurrentNodeStyle-CssClass="s4-breadcrumbCurrentNode"
             RootNodeStyle-CssClass="s4-breadcrumbRootNode"
             NodeImageOffsetX=0
             NodeImageOffsetY=353
             NodeImageWidth=16
             NodeImageHeight=16
             NodeImageUrl="/_layouts/images/fgimg.png"
             HideInteriorRootNodes="true"
             SkipLinkText="" />
          </asp:ContentPlaceHolder>

    Monday, October 3, 2011

    Hide "Home" link in top navigation of SharePoint 2010

    Hide "Home" link in top navigation of SharePoint 2010

    Hide the home node in the top navigation menu of SharePoint 2010

     
    In SharePoint 2007, if we set the datasource providor value of ShowStartingNode="False", the "home" link used to be hidden but if you try the same setting in SharePoint 2010, it does not work.


    ShowStartingNode="False"
    SiteMapProvider="Tried CombinedNavSiteMapProvider and SPNavigationProvider"

    To fix this, I had to use the PortalSiteMapDataSource which used to exist in Moss 2007. To get it working follow the steps below:

    1. Add a register tag to your master page


    2. Add a PortalSiteMapDataSource to the master page

    (Open Square Bracket) PublishingNavigation:PortalSiteMapDataSource


    ID="GlobalNavDataSource"

    Runat="server"

    SiteMapProvider="CombinedNavSiteMapProvider"

    EnableViewState="true"

    StartFromCurrentNode="true"

    StartingNodeOffset="0"

    ShowStartingNode="false"

    TreatStartingNodeAsCurrent="true"

    TrimNonCurrentTypes="Heading" / (close square bracket)

     
     
    3. Update your top navigation to use this data source instead

    (Open Square Bracket)
    PublishingNavigation:PortalSiteMapDataSource


    ID="GlobalNavDataSource"

    Runat="server"

    SiteMapProvider="CombinedNavSiteMapProvider"

    EnableViewState="true"

    StartFromCurrentNode="true"

    StartingNodeOffset="0"

    ShowStartingNode="false"

    TreatStartingNodeAsCurrent="true"

    TrimNonCurrentTypes="Heading"/(close square bracket)



    I have not tested it completly for side effects as I am just trying these things out in 2010. Will update this post if I find any side effects because of this.

    Another way of doing this is through CSS...

     .s4-tn li.static > a {


    display: none !important;

    }

    .s4-tn li.static > ul a {

    display: block !important;

    }

    Sunday, July 31, 2011

    Add user control in sharepoint master page

    Add user control in sharepoint master page

    06/27/2010Admin  
    Category: SharePoint Programming
    In this post we will see how to add a user Control in a SharePoint Master Page, along with its code file. Here we will create a user control with a hyperlink, and will change the title of the hyperlink and its navigation url in the page load of the code file.
    The steps are:
    1. Create the Web user Control (ascx) along with the code file.
    Open Visual Studio and Create a new web application project.

    Add a Web User  Control in your project.

    In the ascx file add a hyperlink control.( like below)

    Now, lets add few lines in our code behind file. See the below image.

    Ok we are done adding the stuff. Now lets build the Project. Oh wait! we didn’t sign the project, since we are going to throw the .dll for this project  into GAC, we need to sign the project with a key.

    2. Signing the Project  -

    firstly, let create a key that we need for signing. To do this browse to the VS tools command prompt (See below ).

    Now, create the key using the command below.

    Now build the Project.
    After you have done this, we need to make one little modification to the ascx file so that it uses what we have written in the code behind. We usually do not deploy .cs or code files along with our ascx or aspx pages in Sharepoint, instead the ascx file accesses the code file, by inheriting from the .dll of the project. so lets change the Inherit tag in the ascx file to something like below :
    Inherits=”MasterPageUserControlDemo.MasterPageUserControl1, MasterPageUserControlDemo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0745576964bce313″
    Now build the Project once again.
    3.  Deploy the Control -
    To add the control in SharePoint context, Open the project folder and just  drag and drop the control into controltemplates folder of SharePoint 12 hive.
    I mean add this under this path : “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES”
    Next, drag and drop your signed assembly into GAC or C:\WINDOWS\assembly folder.

    4.  Now, we are ready to add our user control in our master page -

    So, lets start with registering the user control in the master page . To do this, open your SharePoint site in SharePoint designer and check out the master page.  Now, add the line below
    on the top the page. See the Image below.
    <%@ Register TagPrefix=”ouruc” src=”~/_controltemplates/MasterPageUserControl1.ascx” TagName=”OurSitesLink” %>

    Now lets just add the control anywhere on your page.  I added the below line in the footer of the page . See the image below.
    &gt;ouruc:OurSitesLink id=”Footerlink” runat=”server”/&lt;

    Now check in the page and approve it.
    The Result should be something like below.

    Tuesday, July 19, 2011

    Create a Polling Web Part with SharePoint Designer and the DVWP

    Create a Polling Web Part with SharePoint Designer and the DVWP


    Guest Author: PatCharles Iovanella
    As a continuation of my Best of EUSP article I was asked to expand on the Polling Data View Web Part.  As I stated in my article, �SharePoint surveys leave a lot to be desired, especially from the end user perspective. What if you want to ask only one question and do not want users to leave the current page?  A SharePoint survey is not the answer. But you can use the SharePoint survey and create a custom polling web part via SharePoint Designer and the Data View Web Part. You can turn a one question SharePoint survey into a cool looking Polling Web Part.�
    So let�s get to it!  I�m making a few assumptions that you know how to use SharePoint Designer and are able to complete all the steps without any further elaboration.
    1. Create your one question SharePoint survey
    2. Create a new Demo page using the Web Part Page template. This page will be our sandbox for building the polling web part.
    3. Open SharePoint Designer and then open your new Demo page
      1. Click into any Web Part Zone
      2. Insert Data View Web Part- Data View - Insert Data View
      3. Select the correct Survey Data Source
      4. Select the one question field
      5. Insert Selected Fields - New Item Form
      6.  
      7. Highlight both columns together, right click, Modify - Merge Cells
      8. So, now we have consolidated our survey into a small compact DVWP.  So let�s create a voting button.
      9. Delete the Cancel button and double click on the Save button
      10. Change the Value/Label to �Vote�
      11. Save Demo page and view in browser
    4. From the Demo page, export the Polling Web Part to your desktop
    5. Import the Polling Web Part and add to your page.
    6. Done!
    Now, if you want to take it a step further and add the Graphical Summary responses, you can do that too. I used Christophe Humbert�s Cross List jQuery script to expose the SharePoint survey summary.aspx on the same page as my poll web part. This way every time some takes the poll the page refreshes and displays the real-time poll results. Please refer to Christophe�s instructions in the links provided.

    http://blog.pathtosharepoint.com/2009/03/23/display-a-list-in-another-site-contd/
    http://www.pathtosharepoint.com/sharepoint-user-toolkit/Pages/Cross-Site-List-Snapshot.aspx

    Item is currently unrated. Press SHIFT+ENTER to rate this item.1 star selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+ESCAPE to leave rating submit mode.2 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.3 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.4 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.5 stars selected. Press SHIFT+ENTER to submit. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.

    Friday, July 15, 2011

    Make Title the Link Column in a Document Library and Add the !NEW Icon

    http://www.thesug.org/blogs/SharePointUnwrapped/Lists/Posts/ViewPost.aspx?ID=6

    We all know that new documents added to a library automatically get the !NEW icon listed with the name (filename).  But what if you want the !NEW icon displayed with another column value or want to use the more useful Title column as the document link instead of file name?

    The file name is what links to the document by default, not the title, and that's not always what we prefer to display.  This thread walks you through changing the link from Name to Title and adding the !NEW icon to the Title instead of the default Name field.

    First, create the view you want for your library, such as adding Title to be a display column and possibly removing Name from the view.  For this example, let’s modify the All Documents view on that library to include the Title column.  In SharePoint Designer, go into the Forms folder for the library and open the AllItems.aspx file (or the view you’ve created).  This file manages the specific view created and each view will have its own file.  The image below shows the AllItems.aspx page (the All Documents view) from within the document library named test.
     

     
    In order to modify the view’s headings, you must convert the view to XSLT data view.  With Designer in split mode, right-click on the view to bring up the menu shown below, and click on Convert to XSLT Data View.
     

     
    Once the conversion is complete, click on the Title filed to find the code that displays that field.  Add the following code per the screenshot below to add the !NEW icon to the Title field:

    <xsl:if test="ddwrt:IfNew(string(@Created))"><img src="/_layouts/1033/images/new.gif" alt="New" /></xsl:if>

    If you left the Name column in the view, this code will already exist with that heading, so simply cut from there and past into the Title heading as shown below.

    Custom Date Formats in SharePoint XSL

    http://blogs.msdn.com/b/joshuag/archive/2009/03/25/custom-date-formats-in-sharepoint-xsl.aspx

    There are quite a few posts out there on this topic, but I’m yet to find one comprehensive post that walks through this beginning to end and actually works.  Let’s give it a go.
    A very common scenario for SharePoint publishing sites is to customize the look to suit the customers needs.  Usually this is done with a Content Query Web Part and some custom XSL.  When doing this very often you need to display a date.  You will quickly notice that just displaying the date that SharePoint gives you is not going to be sufficient.  If you just did the standard

    <xsl:value-of select="@ArticleStartDate"/>
    You get back a pretty nasty looking result
    2009-03-23 00:00:00

    However if you use the “FormatDate” function, you can make this look a lot better.
    <xsl:value-of select="ddwrt:FormatDate(@ArticleStartDate, 2057, 3)"/>
    Results in this
    23 March 2009
    All you need to do to make sure the “FormatDate” function is available in your custom XSL files is to make sure you reference the ddwrt namespace.
    xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime
    Once this has been added to the rest of your namespace declarations at the top of your <xsl:stylesheet> tag, you should be able to use the “FormatDate” function anywhere you like.  Here is sample of what a full XSL file would look like that does this.
    <xsl:stylesheet 
    
    version="1.0" 
    
    exclude-result-prefixes="x d xsl msxsl cmswrt"
    
    xmlns:x="http://www.w3.org/2001/XMLSchema" 
    
    xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" 
    
    xmlns:cmswrt="http://schemas.microsoft.com/WebParts/v3/Publishing/runtime"
    
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    
    xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime">
    
    <xsl:template name="Default" match="*" mode="itemstyle">
    
    <xsl:value-of select="ddwrt:FormatDate(@ArticleStartDate, 2057, 3)"/>   
    
    </xsl:template>
    
    </xsl:stylesheet>
    
    Here are the details on the different formats you can get by changing the parameters.  March 23 12:00 AM was used as input for all outputs.
    OutputLocaleFormat
    3/23/200910331
    3/23/2009 12:00 AM10332
    Monday, March 23 200910333
    12:00 AM10334
    Monday, March 23, 2009 12:00 AM10337
    3/23/2009 12:00:00 AM103313
    Monday, March 23, 2009 12:00:00 AM103315
    23/03/200920571
    3/23/2009 12:00 AM20572
    23 March 200920573
    00:0020574
    23/03/2009 00:0020575
    23 March 2009 00:0020577
    00:00:00205712
    23/03/2009 00:00:00205713
    23 March 2009 00:00:00205715
    You can also get a list of all the available locale’s here.

    Thursday, June 30, 2011

    Migrate a Single List to SharePoint 2010 from 2007

    Challenge:
    I recently needed to move a list from SharePoint 2007 to SharePoint 2010.  I wanted the destination list to have the exact content as the source list including structure, list items, and attached files.  Since SharePoint does not have an STSADM.EXE command line tool to accomplish this, it needs to be done manually.  What are our options?

    Solution:
    After doing some research, I discovered that there are a few ways to accomplish this task.  You can migrate a single list from SharePoint 2007 to SharePoint 2010 using one of four methods:
    1. Migrate a single list from SharePoint 2007 to 2010 using a list template
    2. Migrate a single list from SharePoint 2007 to 2010 using an Access table
    3. Migrate a single list from SharePoint 2007 to 2010 using the detach database method
    4. Migrate a single list from SharePoint 2007 to 20110 using PowerShell
    I'll summarize and show how each of these methods works in this article.
    Method 1 - Migrate a single list from SharePoint 2007 to 2010 using a list template
    The first method to consider is creating a list template from SharePoint 2007 and bringing it into SharePoint 2010. But you will likely be disappointed to learn that SharePoint 2010 will not recognize this template, so you cannot create any list from that template.  A workaround for this problem is posted on Tom's Random Ranting blog, showing how you can easily modify the manifest file that gest created every time you create a template.
    Tom's basic method is:
    • Extract the contents of the STP file (it's really just a CAB file)
    • Edit the manifest.xml file, changing the ProductVersion element from 3 to 4
    • Repackage the STP file
    It is quick way to bring a list over, but there is one important limitation: if your source list has many items (thousands), you might not be able to copy the entire contents of the list.

    Method 2 - Migrate a single list from SharePoint 2007 to 2010 using an Access table
    The second way to migrate a list from 2007 to 2010 is to use Access. Basically, you need to export a MOSS 2007 list to an Access table, and then import to SharePoint 2010:
    Step 1:  Open source list with Access

    Step 2: Select Export a copy of the data to a new database

    Step 3: The SharePoint list will now be imported into Access.  You can add or modify columns in this mode to select what you need.


    Step 4: From Access, select External Data tab in the Ribbon, and select SharePoint List in the Export section. Enter a SharePoint 2010 site address and select OK.

    Your result should appear as follows:

    You might be wondering if this method also works with a Document Library since the Document Library doesn't have the menu Action -> Open for Access!  Yes, of course it does, but for a Document Library, you need to use the similar "Open with Windows Explorer" menu action.
    Step 1: Open both Document Libraries with Window Explorer


    Step 2: Select all the documents and folders that you need, and select Copy.

    Step 3: Paste the data into the destination folder.

    And the result is:

    Limitation
    You will notice that one of the limitations of this migration method is that the Modified Date, Created Date, Modified By, and Created By columns do not retain their values from the source list.  You also need to have Microsoft's Access 2010 in order to use this method.

    Method 3 - Migrate a single list from SharePoint 2007 to 2010 using the detach database method
    In this method, we will try to migrate using an STSADM command that is supported by SharePoint 2007.  All we have to do is use the Export and Import command to migrate a list.
    Step 1:  Migrate the entire SharePoint site that contains the list to be exported from 2007 to 2010.  Please refer to an earlier post in the Cookbook series, How to Migrate a SharePoint 2007 Site to SharePoint 2010 Using Database Attach, for the exact steps on how to do this.  You might have to create a new temporary site in SharePoint 2010 in order to migrate the site, but the site can then be removed after the desired list has been migrated.
    Step 2: Once the site has been migrated to SharePoint 2010 server, let's try to move the sample Tasks list.  From Central Admin -> Backup, select Restore -> Export a site or list:

    In the selection drop down box,select the list that you want to move:


    At this point, you have exported the desired list to a folder on your SharePoint server, and you are now ready to import that List to the correct destination.
    Step 3. Next, import the Tasks list to your final destination site.   SharePoint 2010 does not provide a User Interface in Central Admin for Granular Restore operations; therefore, you have to use PowerShell to accomplish this task:

    And below is the result:


    Method 4 - Migrate a single list from SharePoint 2007 to 2010 using PowerShell
    Lastly, we will try to use PowerShell to Export/Import lists. We know that Microsoft has released a version of Windows PowerShell 1.0 that works with SharePoint 2007,  and which can be downloaded here.  After the installation has completed, we can write a PowerShell script to try to accomplish our goal of exporting a list.
    The basic steps are:
    • Run a shell script to export a list to a DAT file
    • Change this DAT file to CAB, and extract this file so that you can access SystemData.xml in the CAB file, and modify version information there.
    • Remake the CAB file and change the extension to .CMP.
    • Use PowerShell in SharePoint 2010 to import the list from the .CMP file.
    Step 1: Launch PowerShell and load SharePoint assemblies to the program.  Refer to this blog post by Nick Grattan in order to prepare your PowerShell for SharePoint 2007: http://nickgrattan.wordpress.com/2007/09/03/preparing-powershell-for-sharepoint-and-moss-2007/:

    Let's write a script to export a SharePoint 2007 List. I will follow an example from Kashish Sukhija's Blog here: http://blogs.sharepointdevelopers.info/2010/05/sharepoint-2010-deployment-using.html.
    [System.Reflection.Assembly]::Load("Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c") 
    [System.Reflection.Assembly]::Load("Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c") 
    $spsite=[Microsoft.SharePoint.SPSite] ("http://cleanmoss/test")
    $spweb=$spsite.OpenWeb()
    $openList=$spweb.Lists["Tasks"]
    $exportObject = New-Object Microsoft.SharePoint.Deployment.SPExportObject
    $exportObject.Type = [Microsoft.SharePoint.Deployment.SPDeploymentObjectType]::List
    $exportObject.IncludeDescendants = [Microsoft.SharePoint.Deployment.SPIncludeDescendants]::All
    $settings = New-Object Microsoft.SharePoint.Deployment.SPExportSettings
    $settings.ExportMethod = [Microsoft.SharePoint.Deployment.SPExportMethodType]::ExportAll
    $versions = [Microsoft.SharePoint.Deployment.SPIncludeVersions]::All
    $settings.IncludeVersions = $versions
    $settings.IncludeSecurity = [Microsoft.SharePoint.Deployment.SPIncludeSecurity]::All
    $settings.OverwriteExistingDataFile = 1
    $settings.SiteUrl = $spweb.Url
    $exportObject.Id = $openList.ID
    $settings.FileLocation = "C:\Temp\BackupRestoreTemp\"ExportList-"+ $openList.ID.ToString() +".DAT"
    $settings.BaseFileName = "
    $settings.FileCompression = 1
    $settings.ExportObjects.Add($exportObject)
    $export = New-Object Microsoft.SharePoint.Deployment.SPExport($settings)
    $export.Run()
     

    After you have run this shell script you will have your export list in the c:\temp\BackupRestoreTemp\ folder.
    Step 2:  Next, all we have to do is change this DAT file to CAB, extract the file so that you can access SystemData.xml in the CAB file, and modify the version information there. Open the SystemData.xml file in a text editor, and change Version="12.0.0.0" to Version="14.0.0.0", and Build="12.0.0.6514" to Version="14.0.4762.1000".
    Step 3:  You will have to create a new CAB file again after making the changes above.  Here is a reference showing how to make a CAB file using the Makecab.exe command: http://msdn.microsoft.com/en-us/library/dd583149(office.11).aspx.  This is sample content to create the CAB:
    .OPTION EXPLICIT     ; Generate errors 
    .Set CabinetNameTemplate=ListTasks.cab       
    .set DiskDirectoryTemplate=CDROM ; All cabinets go in a single
    .Set CompressionType=MSZIP;** All files are compressed in cabinet files
    .Set UniqueFiles="OFF"
    .Set Cabinet=on
    .Set DiskDirectory1=ListTasks.CAB
     
    ; Include all files need to be presented in Cab.
    manifest.xml
    ExportSettings.xml
    Requirements.xml
    RootObjectMap.xml
    SystemData.xml
    UserGroup.xml
    ViewFormsList.xml
    00000000.dat
    00000001.dat
    00000002.dat
    00000003.dat
    00000004.dat
    00000005.dat
    00000006.dat
    00000007.dat
    00000008.dat
    00000009.dat
    0000000A.dat
    0000000B.dat
    0000000C.dat

    Step 4: Finally, we can use PowerShell on SharePoint 2010 server and run the Import-spweb to import the list.

    Result:

    In summary, if you have a need to just import a SharePoint list from an existing SharePoint 2007 farm to a SharePoint 2010 farm, there are several ways to accomplish this task.  Which method you should use will depend on the tools that you have available, and your familiarity with each of them.  Note: There are also third-party tools available to help you with migrating sites and content in SharePoint and, for list migration specifically, you may wish to look at Bamboo's own List Bulk Import product.

    Notes:
    • Using the last two methods described, we will be able to retain the original values of Modified Date, Created Date, Created By, and Modified By from the source list. Make sure to specify the parameter -IncludeUserSecurity in your import command.
    • Most of the steps we have shown in this article will require you to have Farm administration rights in order to run the necessary import and export commands.
    • If your source list contains any custom columns, you might have to install that feature on the destination SharePoint 2010 farm before doing the migration.

    See Also:

    Thursday, June 16, 2011

    How to make an application page (_layouts page) in SharePoint anonymous?

    Scenario:
    How to make an application page (_layouts page) in SharePoint anonymous?

    Explanation:
    The application pages (custom pages that are created inside the layouts folder) in SharePoint  will ask for authentication even when a user tries to access them from a site that is configured for anonymous access (public facing site).

    Resolution:

    • Make sure that the application page is inherited from "Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase"
    • Override the AllowAnonymousAccess property and return true

    If the application page does not have code-behind, the below snippet will mark the property "AllowAnonymousAccess" to true:

    protected override bool AllowAnonymousAccess

        get
        { 
            return true; 
        } 
    }
    </script>



    download file, (tested):
    https://sites.google.com/site/nidovan82/WebTaggingDialog.aspx?attredirects=0&d=1


    original post:
    http://underthehood.ironworks.com/2010/11/how-to-make-an-application-page-_layouts-page-in-sharepoint-anonymous.html

    Wednesday, June 15, 2011

    Cascaded Lookups Sharepoint 2010 - JavaScript based

    tested
    Note: Make sure to add Content Editor Webpart after the edit form. and the source lists need to be in the same site.

    http://spcd.codeplex.com/releases/view/40417

    Monday, June 13, 2011

    JQuery - Navigate and Replace HTML Code

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>

    $(document).ready(




    $(theLink).replaceWith(open
    });
     

    <script type="text/javascript"> function() {var theurl = $"div[Title='facebookLink'] > a") ;var theLink = $"div[Title='facebookLink']"); var open = '<a href="';var close = '"> link </a>';+ theurl.attr('href')+ close);</script> ((