Search This Blog

Wednesday, March 25, 2015

Creating form in InfoPath 2010 and publishing to SharePoint 2010

How to create a simple form using InfoPath 2010 and publish to SharePoint 2010 so that it can be filled using web browser?

In this post, I am going to create a simple form using InfoPath 2010 and publish the form to a SharePoint 2010 library and open the form using Web Browser

1. Open InfoPath 2010 Designer and Click on File | New | Select Blank Form | Click on Design Form 
Creating Blank Form in InfoPath 2010
2.  Blank Form Template in InfoPath 2010 is created. Now I want to insert tables 
Blank Form template in InfoPath 2010
3. Click on Insert tab and select the table format which you want 
Insert Table in InfoPath 2010
4. Adding control to InfoPath 2010 Forms 
To add controls to your form, click on HOME tab and go where it says Controls 

image
5. If you want to add InfoPath form 2010 controls similar to InfoPath form 2007, just click on the control pane 
Control  Pane in InfoPath 2010
6. Now your control pane is will look like InfoPath 2007 format. 
InfoPath 2010 Control similar to InfoPath 2007
7. Let’s go and add controls to our new InfoPath 2010 forms.  
I added four input text fields. To go to properties of the filed, just double click and name the properties 

Adding Controls to InfoPath 2010 Form
Properties of the Fields in InfoPath 2010 forms 
InfoPath 2010 Fileds Properties
8.  Now the form is ready and let’s go and publish this to SharePoint 2010 Form library. 
      Data | Form Options
Form Submit Options in InfoPath 2010
9. InfoPath 2010 Submit Form Options:
If you want to submit the form to SharePoint Document Library, put a check in Allow users to Submit this form 
Other options are “Show the submit button in both the ribbon and the info tab in the InfoPath filter
image
10. If your satisfy with all the all the options, click Ok. This will give you a message saying “ You must select a data connection for Submitting data to a SharePoint document library. To create a new data connection, click ADD”
Let’s go and click Add to create new data connection to SharePoint 2010 Document Library 
image
11.  Data Connection Wizard: This wizard helps you to specify a data connection for submitting the form to a document library on SharePoint site. The form will be submitted with the file name specified below 
I already have created a Form Library in SharePoint 2010.  If you don’t have the link for the Form Library go to your SharePoint site and create a Form Library.
In File Name, I selected as name and the form will be submitted with the file name specified below 
InfoPath 2010 Data Connection Wizard
To insert File Name : Click on Fx Icon
Insert Filed or Group in InfoPath Form 2010
12. Enter a name for this data connection and click on Finish and Ok for next Window
Name for Data Connection in InfoPath 2010
13.  Now the data connection to document library is completed and now we can publish the form to SharePoint 2010 
To publish the form,  go to File | Publish and | SharePoint Server |
Publish form to a SharePoint Library 
- Create or update a form library form on SharePoint 
- Users can access this form Online 
Publish form to a SharePoint Library
14. Publishing Wizard will come up to publish the form to SharePoint Document Library.  In  here the wizard wants you to enter the location of your SharePoint or InfoPath Form Services site.  
Enter the site name which you want to publish the form. 
Click Next InfoPath Form Services Site

15.  Enable this form to be filled out by using browser if you want user to fill the form online.  Also we are publishing this form to a document library

Publishing to Form Library in InfoPath 2010
16. What do you want to do? 
- Create a new form library or Update the form template in an existing from library.
Since I already have a form library created, I am going to update my form template in an existing form library 
Create a new form library InfoPath
17.  The files listed below will be available as columns in SharePoint sites and Outlook Folder.  Go head and select the fields which you want to capture. 
Selecting Fields in Infopath

18.  Click next and publish the InfoPath form to SharePoint 2010 Library 
SNAGHTML4dc07a7

19. Form is published to SharePoint and click on open in  form in the Browser
Open InfoPath form in browser

20. InfoPath Form opens in browser and it’s ready to be filled and submit to form library.
Submit Form to SharePoint
21. Form filed information are captured in Form Library in SharePoint 2010

Form data in Form Library

Tuesday, March 24, 2015

Hide the SharePoint 2010 Ribbon without Modifying the Master Page


Ever wish you could hide the SharePoint 2010 Ribbon from visitors to your site who have no need of it? Want to reclaim that 50 to 100 pixel waste of screen real estate at the top of your page but don't have access to your site's Master page? Well, read on! 

In order to effectively hide the Ribbon from those who don't need it, the best option is to security trim the area in your site’s master page. However, not all site owners have access to SharePoint Designer or if they do, don’t have permissions to modify the master page. Still other owners / administrators may not want to hide the ribbon on every page but only on a select set of pages. The problem is easily managed using Cascading Style Sheets (CSS). 

To begin, create a CSS file containing the following lines (or add these lines to an existing custom CSS file if you’re already using one for your site):

/* Hide Ribbon */

#s4-ribbonrow {

display: none;

}
Save the file to your site's asset library. If you're not using one, now is a good time to create one. Save the URL to the file. Next, add a Content Editor Web Part to the page on which you want the Ribbon hidden. Edit the CEWP’s HTML source and add a link to your CSS file:
<link href="/sites/YourSite/YourLibrary/PageStyling.css" rel="stylesheet" type="text/css"/>
(Note: Using the relative URL as shown above versus the absolute URL that includes "http://" can save you some headaches in the future.)

Edit the CEWP's settings and change the chrome to none or set the “Hidden” property under “Layout” to true. If you're anal like me, do both. Once you save the link in the CEWP, voila! Your Ribbon has vanished! Problem solved!
Or is it? Now  YOU can’t see the ribbon either. What happens when you need to edit the page? If your site is standard out of the box SharePoint, you can’t access the Site Actions menu now! As a matter of fact, now that you’ve added this code, you can’t even do anything to the page other than edit existing web parts that don't have the title bar hidden! You can’t even undo what you just did because you can’t access the HTML source of your new CEWP! What are you going to do?!
First, you’re going to stop panicking! We’ve got this under control! If you have access to SharePoint Designer, open your site, locate the library where you stored your new CSS file and open that document. If you can’t use SPD, open the copy of your CSS file that you created on your desktop. Move the closing brace (*/) from the “Hide Ribbon” comment to the end of the line as shown below:
/* Hide Ribbon

#s4-ribbonrow {

display: none;

} */
If using SPD, save the file. If you had to modify the file on your desktop, upload the modified file to the library where you stored your original. What? You can’t access the Site Actions menu to get to the “View All Site Content” link and it’s not available on your Quick Launch? No worries. Replace everything past your site’s name in the URL with this “/_layouts/viewlsts.aspx” and hit enter.  
Once you’ve modified the CSS file as shown or uploaded your modified file to your assets library, refresh or reload the page. Voila! Your Ribbon reappears!
Now how are we going to allow administrators to see the ribbon and still hide it from users who only have read access? Again, the best way to do this would be security trimming the #s4-ribbonrow element, but you’re here because you can’t do that for whatever reason. Instead, we’re going to create another CSS file containing the following:
/* Show Ribbon  */

#s4-ribbonrow {

display: block!important;

             }
Name your new file “Admin.css” (or something else that helps you know what it is at a glance) and upload it to your assets library. Return to the page where you’re trying to hide the Ribbon from those pesky site visitors and put the page back into edit mode. Add another CEWP to the page. As with the first, edit the CEWP settings so the chrome is "None" and/or the “Hidden” property is true. Edit the CEWP’s HTML source and add the link to your new Admin.css file. Save your changes and voila! No, just kidding. We’ve got a few more steps. 

If you don’t know CSS, what we just did was tell the browser that we want to display the Ribbon after we told it in the previous file that we want to hide it. Why’d we do that? Are we losing it? Well, maybe, but that’s irrelevant. When a browser reads through a list of CSS styles, it applies them as it comes to them. Adding “!important” after “block” in our code tells the browser that no matter what other commands it sees regarding the display of the Ribbon, obey THIS one because it’s…you guessed it…IMPORTANT! So it doesn’t matter if you put the CEWP containing the Admin.css link before or after the CEWP containing the CSS that hides the ribbon, it’s going to display the Ribbon because this tag is marked “!important”.
Right. So now that you’re thoroughly confused, let’s continue. You now have two options. Again, if you’re anal like me, you can do both. For option one, since we’re in the properties of the CEWP containing the Admin.css link already (you’re still there, right?), we’ll jump down to the “Advanced” section and find “Targeted Audiences”. Here, you’ll enter the name of your administrative group (i.e. Site Owners) and any other group that you want to be able to see the Ribbon (i.e. Content Managers, etc). Save the properties and voila! Only those you designated will see the Ribbon!
For option two, save your page and visit your assets library. Find the Admin.css file and break inheritance on its permissions. Remove all groups other than your administrative group and any other groups you want to see the Ribbon (add them if you need to). Voila! Only those you designated will see the Ribbon! 

Centering the body of SharePoint 2010 in a fixed width

Here is how to center the width of the body in SharePoint 2010, you use the nosetwidth class for the workspace.
<div id=”s4-workspace” class=”s4-nosetwidth” style=”position:relative; width:1024px; margin-right:auto; margin-left:auto; background:white;”>

clip_image002
clip_image004

How to Hide Top Bar, Ribbon, Quick Launch in SharePoint 2010?

Sometimes, there's the need to include Sharepoint web parts in external web applications without showing elements derived from the master page (i.e. ribbon, navigation bars, title bar, etc.). The CSS snippet below is an easy way to hide unwanted elements by using CSS only, without changing the ASPX code.
1: Create a CSS file named (for example) zero.css in the Style Library as follows
<style type="text/css">
/* Resizes to 0 the upper margin of the main area */
.ms-pagetitleareaframe table { background: none; }
/* Hides the left navigation area (quick launch bar) */
#s4-leftpanel-content { display:none !important; }
/* Resizes to 0 the left margin */
.s4-ca { margin-left:0px !important; margin-right:0px !important; }
/* Hides title and breadcrumb bar */
.s4-title { display:none !important; }
/* Hides the top navigation links */    
.s4-tn { display:none !important; }
/* Hides the top navigation container bar */
.s4-notdlg { display:none !important; }
/* Hides the search box */
#SRSB { display:none !important; }
/* Hides the help button */    
.s4-help { visibility: hidden; }
/* Hides user name in the top right corner and the related menu */    
.s4-trc-container-menu { visibility: hidden; }
/* Hides the ribbon */
.ms-cui-ribbonTopBars{ display:none; }  body #s4-ribbonrow { min-height: 0 !important; display:none !important; }
</style>
2: link the CSS file in the desired master page by adding this line:
<link href="/Style%20Library/zero.css" rel="stylesheet" type="text/css" />
just above this line: <asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server"/>
I suggest not to edit the original master page, but to make a copy and modify it.
I noticed slight differences in display, depending on the edition and version of Sharepoint. The code is substantially the same, but may require a minimum adjustment to the context.

SharePoint 2010–Fun with Scrollbars!

Change How the Page Scrollbars Work

SharePoint uses JavaScript to make sure the ribbon stays at the top of the page. This results in the ribbon staying fixed, but also means that we have a custom scrolling area below the ribbon. If you prefer more natural scrollbars then take a look at Kyle Schaeffer's article here: http://kyleschaeffer.com/sharepoint/sharepoint-2010-scrolling/
Below is the before and after of Kyle's changes. While the cosmetic changes are minor, Kyle lists additional benefits in his article.
    

Add Scrollbars to Quick Launch

Note: If you just want to tighten up the Quick Launch area then see this article:http://techtrainingnotes.blogspot.com/2011/10/sharepoint-2010-365-tighten-up-quick.html
When you scroll down in a SharePoint page to find what's at the end of the Quick Launch area you also scroll the top navigation area out of site. This area has the site title, top link bar, search and the Tags and Notes buttons. To be able to browse the Quick Launch area without scrolling the entire page add this CSS to your master page:
.ms-quicklaunch-navmgr
{
    overflow-y:scroll;
    height:200px;
}
You will need to carefully select the height property and/or write some JavaScript to set the height based on the user's browser settings.
    image 
If you want to scroll the entire left navigation area then use this CSS:
#s4-leftpanel-content
{
    overflow-y:scroll;
    height:300px;
}
    image
Setting the height of this area gives you a little bonus of adding text or links just below the navigation area. Search for "MSO_ContentTable" in your master page and place your content between the two "</div>" tags above this line. (This example is for the standard v4.master page. Yours may be different.)
    image

Add Scrollbars to the Content Area of the Page

If you would like to always leave the Navigation area on the left side of the page and the title area on the top of the page you will need add scroll bars to the primary content area ("ms-bodyareacell"). You will need to carefully select the height property and/or write some JavaScript to set the height based on the user's browser settings.
.ms-bodyareacell
{
    overflow-y:scroll;
    height:400px;
}
image

Add Scrollbars to a Web Part

This one is easy as it can be done from the web part's properties panel. Just click the web part's dropdown menu, click Edit, expand the Appearance section and enter the height.
    image
Here's the result:
    image
If you really want to force a web part or all web parts to display at a fixed size you could set the .ms-wpContentDivSpace class. Most likely you will want to do this at a single page level instead of in the master page.
.ms-wpContentDivSpace
{
    height:200px;
}
If you want to change the height of a single web part then view the source of the page and search for "#MSOZoneCell_WebPartWPQ" until you find your web part. Copy the name that you find there, including the digit at the end and add it to your style selector.
#MSOZoneCell_WebPartWPQ5 .ms-wpContentDivSpace
{
    height:200px;
}

Show or Hide SharePoint 2010 ribbon based on SharePoint Groups

Project Description
This SharePoint 2010 solution allow site administrator to define who can or cannot see the SharePoint ribbon.

In few words
With this solution you can on each site define if the ribbon is display or not for :
  • Everyone
  • Anonymous user
  • for one or many specific SharePoint groups

Screenshots

screen1.jpg screen3.jpg 

screen4.jpg screen2.jpg

Installation
  • stsadm -o addsolution -filename PATH\ConsultPoint.SharePoint.RibbonVisibility.wsp
  • stsadm -o deploysolution -name ConsultPoint.SharePoint.RibbonVisibility.wsp -allowgacdeployment -immediate
  • Activate the feature named ConsultPoint.SharePoint.RibbonVisibility on your site collection

Monday, March 23, 2015

SharePoint 2010 Search list using OOTB Text filter Web Part

SharePoint 2010 Search list using OOTB Text filter Web Part

The SharePoint Text filter web part is simple to deploy as a search input for your SharePoint list or library view, you simply add it on your view’s page, connect it to your data view web part and choose the column to filter by, neat and easy, but the disadvantage of it all is that your search has to be exact and case sensitive which makes it not very useful.
The solution – follow this simple steps to configure your text filter with a little help from SharePoint Designer that make it work as a search box on your list view without the disadvantages described above:
  1. Open your site in SharePoint Designer –
  2. In SharePoint Designer go to Lists and Libaries and click on the list or library you wish to add a search view for –
  3. Create a new view for your list and call it “Search”.
  4. Click on your new view’s name in order to open it’s page in design mode –
  5. In desgin view click on the div above your list view, and then on the desginer ribbon go to the “insert” tab, click on the “web part” button, and choose to insert the “text filter” web part from the “filters” folder on to your page, just above your list view –
  6. Left click your list view and then look for the “Parameters” on the “List View Tools” options tab on your ribbon and click it -
  7. Create a new parameter, you can leave the default options and the default name value “param1″ as is and click OK –
  8. Click the list view tools “Filter” button –
  9. Create a filter stating that the column you want to use as a search field contains your parameter –
  10. Right click your text filter web part and choose to add a connection –
  11. Choose “Send Filter Values To” from the combobox and click Next –
  12. Click next to connect to a web part on your page –
  13. Choose “Get Parameters From” as your target action and click next –
  14. Click the your parameter name and your text filter name and then click next –
  15. Click finish and then save your page –
  16. Open your page and search your column using partial text and uppercase or lowercase, you should anyway get search results.
  17. You can also create filters that are more complex, and search through a number of columns at once using this solution, hope you find this useful!