Dec 9, 2011

Recommendations for maintaining Infopath performance

I'm creating an InfoPath form that is a bit large and starting to lag so I decided to look up better practices for developing InfoPath forms to maintain performance. Here is what I found online:
- Keep views from being too large or complex. Split large views into several smaller ones with buttons to switch between them.
- Avoid lots of tables (data or layout) in any single view.
- Use Master/Detail to reduce the number of controls in one page, whenever possible.
- Try to use filter to filter the table rows (instead of conditional
formatting).
- Avoid large repeating data structures that can grow to many pages.
-Avoid complex nesting of optional and repeatable sections. These are quite complicated to layout and also can quickly cause a single view to become very large.
- Avoid using Percentage width for your controls if your view contains lots of nested controls. We have seen over 50% improvements by using Fixed Width. You can apply specify a fixed width in the control's properties dialog.
- Be aware of exactly what your business logic does. For example, onAfterChange can fire multiple times for a single edit.
- Rather than querying for all the data then having InfoPath just show a small amount, refine your query and only bring the data you plan on displaying into InfoPath.
- Only get the data you need to load the form. Don't pre-populate data sources that aren't necessary on load.
- Merge static xml data sources into one if you have multiple xml data connections.
- Use Expression Box to display calculated value if you don't need to store the value. If you have business logic to trigger all the calculation, only trigger necessary calculation. Triggering large amount of calculations is costly.
- When using digital signatures, only digitally sign the information you need to. Signing takes a screenshot of the data signed and encodes it in the form. The larger the screenshot, the larger the xml will become with the encoded image.
- Avoid attaching large files to the form. These files are encoded in the xml and can cause issues if they become too large. Provide links over embedding large files if possible.
- Avoid embedding images in a form. For the same reasons as above.

SharePoint Designer opens in contributor mode

We may face some situation, while editing the site using Sharepoint Designer, it will get open in Contributor mode and we will not be able to edit the site, eventhough we have the Site Collection Administrator(SCA) permission.
 By default, Contribute permissions are assigned to the Site Collection Members  group. Even though, we are part of SCA group, if we are member of Site Collection members the Designer will open in Contributor mode.
To overcome this just disable the contributor settings in SharePoint designer by using the below steps:
1. Open the site in SharePoint Designer.
2. Select the Site Tab -> Contributor Settings.
3. Click on Disable Contributor settings button.
Now we will be able to edit the site.

How to convert Infopath form to word document

Sometimes you may need to convert an InfoPath form into a Word document so you can send it to users that either don’t have InfoPath or can’t access your  SharePoint form library. Luckily there is an easy process to do so.
Steps to convert InfoPath form to Word:
1) Open your .xsn InfoPath project file
2) Go to File -> Export To -> Web
3) Enter a name for the file and make sure “Single File Web Page (*.mht;*.mhtml)” for Save as type is selected. Click Export
4) Locate your new .mht file and open it with Word.
5) You should see your InfoPath form in Word. You may have to adjust any checkboxes or radio buttons that may be on the form. Make sure to save the file as a .doc or .docx file type when you’re done

Integrating Twitter and FaceBook in SharePoint

I would like to share the link which is very simple and clear way of integrating the twitter and facebook in SharePoint.

Twitter Integration


Face Book Integration



Nov 24, 2011

Checking whether a file uploaded is of .doc or .docx file format

We can use the Java Script to check whether the file uploaded is of 2003 or 2007 word format. Hence we can handle the validation in the client side.
Java Script
<script type="text/javascript" language="javascript">
   function FileFormatValidate()
   {
        var uploadControl = document.getElementById('<%=FileUpload1.ClientID%>').value;
        //Regular Expression for the fileupload control.
        var reg = /^(([a-zA-Z]:)|(file://%7b2%7d/w )/$?)(//(/w[/w].*)) (.doc|.docx|.DOC|.DOCX)$/;
        //Checking if the file is empty or not
        if (uploadControl.length > 0) 
        {
            //Checks with the control value.
            if (reg.test(uploadControl)) 
            {
                return true;
            }
           else 
            {
                //If the condition not satisfied shows error message.
                alert("Only .doc, docx files are allowed!");
                return false;
            }
         }
        else 
        {
            //If the File is Empty or No File is  selected to upload shows this 
error message.
            alert("Please select a file to Upload");
            return false;
        }
    } //End of function FileFormatValidate.
</script>
Design
<p style="height: 28px; width: 216px">
    <asp:Button ID="btn_Upload" runat="server" Height="25px" 
        onclick="btn_Upload_Click" OnClientClick="return FileFormatValidate();" Text="Upload" Width="128px" />
</p>

Hence you can validate and check the file being uploaded at the client side using this code. This can be re-used for any file formats by changing the Regular Expression.
Happy Coding!!!


List of SharePoint 2010 Web Parts

Authoring
 Content Editor 
 Image Viewer
 Media Web Part
 Page Viewer 
 Silverlight Web Part
Business Data
 Business Data Actions
 Business Data Catalog Filter
 Business Data Item
 Business Data Item Builder
 Business Data List
 Business Data Related List
 Key Performance Indicators
 KPI Details
 Visio Graphics Service 
Content Rollup
 Chart Viewer
 Content Query
 HTML Form Web Part - Foundation
 Picture Library Slideshow Web Part
 RSS Viewer
 XML Viewer
 What’s Popular
Documents
 Document ID Lookup
 Document Set Contents
 Document Set Properties
 Relevant Documents
Filters
 Choice Filter
 Current User Filter
 Date Filter
 Filter Actions
 Page Field Filter
 Query String URL) Filter
 SharePoint List Filter
 SQL Server Analysis Services Filter
 Text Filter
My Information My Calendar
 My Contacts
 My Inbox
 My Mail Folder
 My Tasks
Navigation
 Categories
 Site Aggregator
 Sites in Category
 Summary Links
 Table of Contents
 Tag Cloud
Office Client Applications Excel Web Access
 InfoPath Form Web Part
 WSRP Viewer
People
 Contact Details
 Profile Browser
 Site Users - Foundation
 User Tasks - Foundation
PerformancePoint
 PerformancePoint Filter
 PerformancePoint Report
 PerformancePoint Scorecard
 PerformancePoint Stack Selector
Search Advanced Search Box
 Dual Chinese Search
 Featured Content
 Federated Results
 People Refinement Panel
 People Search Box
 People Search Core Results
 Refinement Panel
 Related Queries
 Search Action Links
 Search Best Bets
 Search Box
 Search Core Results
 Search Paging
 Search Statistics
 Search Summary
 Top Federated Results

Deafult.aspx is not opening in the SharePoint Designer

PROBLEM: Deafult.aspx is not opening in the SharePoint Designer


Error Details   

     Soap: Server was unable to process request. A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered as safe on this site. You may not be able to open this page in an HTML editor that is compatible with Microsoft Windows SharePoint Services, such as Microsoft Office SharePoint Designer. To fix this page, contact the site administrator to have the Web Part or Web Form Control configured as safe. You can also remove the Web Part or Web Form Control from the page by using the Web Parts Maintenance Page. If you have the necessary permissions, you can use this page to disable Web Parts temporarily or remove personal settings. For more information, contact your site administrator.


Solution       

The problem is that the default.aspx page may contain some error web parts which can be removed by hitting the following url


This will open the web part maintenance page. So, here you can delete the error web part.


What is 12 and 60 Hive in SharePoint ?

You'll hear SharePoint people talk about and refer to the "12 Hive" or the "60 Hive" regularly. We don't know what it is and we use it .

The "Hive" concept was coined by Todd Bleeker. So what does it mean?
12 Hive is the location where MOSS 2007 and WSS 3.0 install their files on the file system. 
The same thing applies to 60 Hive which, as you may guess is the location of SPS 2003 and WSS 2.0 files. 

Locations:
12 Hive C:\Program Files\Common Files\Microsoft Shared\web server extensions\12
60 Hive C:\Program Files\Common Files\Microsoft Shared\web server extensions\60

Migration of WSS 3.0 to SharePoint Server 2010

I have some ideas grabbed from the internet regarding the migration of WSS 3.0 to SP 2010 server. My thoughts are as follows.
1. WSS 3.0 (with SP2) can be migrated to SharePoint Foundation 2010 directly.
2. The migration of WSS 3.0 (with SP2) to SharePoint Server 2010 is possible by attaching DB upgrade only. The direct migration is not possible.
3. But the WSS 3.0 (with SP2) can be migrated to MOSS 2007 first then to SP Server 2010
Ref: http://technet.microsoft.com/en-us/library/cc262747.aspx