SharePointAds TextOnly

Monday, 27 June 2011

SharePoint 2010 : Print Calendar list on a single click

Do you want to print SharePoint 2010 list at a single click?
Yes, now you can print your SharePoint 2010 list in single click using SPPrintListButton solution.
I have provided Sandbox solution which will add new "Print" button on the top ribbon for SharePoint List. As of now I have created for Calendar lists.
Print List Button


Please have a look at my codeplex solution to download and install feature in your SharePoint 2010 list.
CodePlex Solution: Download From CodePlex

Important Update:  After lots of print button image view error requests, updated solution to work with subsites calendar lists. Please visit at same CodePlex page to download updated version.
And let me know if you get previous error again.
.

Thursday, 9 June 2011

SharePoint 2010 : how to open Modal Dialog in ECB Menu

You can open model dialog in SharePoint site using the following code:

<script type="text/javascript">
function openDialog() {
     var options = {
          url: "demopage.aspx"
         width: 600,
         height: 300,
         title: "My PopUp",
     };
     SP.UI.ModalDialog.showModalDialog(options);
 }

</script>
<div>
    <a  onclick="javascript:openDialog(); return false;">Click Herea>
    <asp:Button ID="btnDialog" runat="server" Text="Open Dialog"  OnClientClick="javascript:openDialog(); return false;"/>
</div>

But what if you want to open dialog from ECB menu? Create new custom action in Element.xml file and in UrlAction tag use the following javascript function.

<Elements xmlns="http://schemas.microsoft.com/sharepoint/"
    <CustomAction
        Id="{B0B5A0CB-7FBE-4dd6-9B2A-2B1E1321B8F9}"
        RegistrationType="List"
        RegistrationId="101"
        Location="EditControlBlock"
        Title="Goto My Blog">     
        <UrlAction Url="javascript: function onClose(){ }
          var o = {
            url: 'http://www.niteen.co.cc',
            title: 'MyBlog',
            allowMaximize: true,
            showClose: true,
            width: 700,
            height: 500,
            dialogReturnValueCallback: onClose
          };
          SP.UI.ModalDialog.showModalDialog(o);"/>
    </CustomAction
</Elements>

In above code, I created new ECB menu for “Document library”, you can create ECB menu for any lists by changing RegistrationId , you can find all required Register Id here.
If you are not able to see modal dialog then change the <UrlAction> tag with following function.

<UrlAction Url="javascript:(function () {
        var o = {
        url:'http://www.niteen.co.cc',
        title: 'MyBlog',
        allowMaximize: true,
        showClose: true,
        width: 700,
        height: 500
        };
        SP.UI.ModalDialog.showModalDialog(o); }) ();"/>




Wednesday, 23 February 2011

How to resolve "The language-neutral solution package was not found" error?


Many of developers faced with this error while deploying SharePoint solution from Visual Studio.
I tried many different ways to solve this error like


Delete the following folders from the project directory(In Visual Studio, Right click on project in "solution explorer" window and select 'Open folder in Windows Explorer' ;) )

  • bin
  • obj
  • pkg

and then IISRESET (Goto start > Run > and write IISRESET and press ENTER ) 


Sometimes it works but not every time, So what is the another solution to remove this error while deploying?


Here is simple tric to resolve this problem.. :)
Just open powershell (or Sharepoint management shell) and execute following command,
(get-spsolution YourSolution.wsp).Delete()


that's it.. now you can deploy solution without getting "The language-neutral solution package was not found" error.
*Note: Change "YourSolution.wsp" name to your WSP file name.

Saturday, 29 January 2011

Change Sharepoint site home page to Sub-site page

Sharepoint 2010 has given top ribbon from where you can change any sharepoint page as home page for current site by "Make this page as Home page"


But there is one limitation, you cannot assign sub site pages as top site home page.

Then how could you do this change? Is there any way to change default home page to the sub-site pages? Even you cannot change default home page from IIS.

I googled for this and found another way to change default home page path. You have to change into web.config file of Sharepoint site(you can find web.config by looking at Local_Drive:\Inetpub\wwwroot\port_number or check this blog for more details http://blog-sharepoint.blogspot.com/2009/12/where-is-sharepoint-webconfig.html )

Edit your site web.config file with following lines (under system.web )

<urlMappings enabled="true">

<add url="~/" mappedUrl="/french/Pages/Default.aspx"/>

</urlMappings>



Save above changes to web.config file and reset IIS. And now browse for the site, you will see the changes.

you can change default home page in both Sharepoint 2010 and MOSS 2007.

Thursday, 30 September 2010

SharePoint Manager 2010

The SharePoint Manager 2010 is a SharePoint object model explorer. It enables you to browse every site on the local farm and view every property. It also enables you to change the properties.

Really very useful for SP developers and admins!


You can download Sharepoint Manager 2010 from Codeplex.

Wednesday, 25 August 2010

How to get approvers user name in workflow?

When you assign workflow task to any group and how would you get task approvers user name? Task list can show only 'assigned to' column which will give you group name only.
You can fetch approvers user name by creating custom List item event receiver for task list. Create Item updated event receiver and add following code...

public override void ItemUpdated(SPItemEventProperties properties)
{
base.ItemUpdated(properties);

SPListItem oListItem = properties.ListItem;
oListItem["ApprovedBy1"] = properties.UserDisplayName;
oListItem.Update();
}

*Note: Create new column for workflow task list. I created new column with 'ApprovedBy1' name.

Saturday, 7 August 2010

How to Edit User Profile in Sharepoint 2010?

If You have to modify user profile information from 'People and Groups' option in Sharepoint site then you can't directly edit user profile information. Even on edit user page you will see only non editable data.

User profile information can be change from 2010 central administration site. Follow the steps to modify user profile or user properties.
  1. Login Central Admin site
  2. Click on 'Application Management' option menu from left navigation
  3. In 'Service Application' section, click on 'Manage service applications' link
  4. From this serviceappliction page, click on 'User Profile Service Application' link
  5. And then you can see lots of options for people, synchronization, Organizations, My site settings etc etc,
  6. On same page, under People section click on 'Manage User Profiles' link
  7. find the user and click on User name from below grid, select 'Edit My Profile' option
  8. You can change user profile on edit form.
  9. Click on 'Save and close' button
By default it could take up to some time to reflect the new updated information througout all web applications bound to the user profile service application. A timer job is taking care of this and you could kick this one of to run manually once by going to "Check Job Status" screen in Central Admin (http://site/_admin/Timer.aspx).