Showing posts with label Sharepoint. Show all posts
Showing posts with label Sharepoint. Show all posts

Monday, December 6, 2010

Accessing data across domain is not supported - Error Popup in InfoPath 2007 to 2010 and MOSS 2007 to 2010

Problem Scenario:


                  I have migrated the InfoPath form 2007 to 2010 and MOSS 2007 to 2010, after successful migration while opening the infoPath form i am getting the following error message 
"Accessing data across domain is not supported ....... "
                   This was work fine in "Preview Mode"


                   If I have changed the trust level as "Full " its work fine for me, but while publishing this for into the form library this has administrator approval.


Root cause:


                  In DataConnection library items has User credential as plain text (Embedded Authentication). For security reason it's block all the across domain access.


Solution :


                  1. Login into Central Admin 


                  2. click General Application Settings.


                  3. On the General Application Settings ->  InfoPath Forms Services section -> click Configure InfoPath Form Services.






                  4. Configured the necessary changes in that page,


                  5. Especially, In the "Embedded SQL Authentication" section, select the Allow embedded SQL authentication check box to allow forms to use embedded SQL Server credentials.




  


                  6. Restart the IIS and Try NOW :)







Monday, November 1, 2010

How to increase the SharePoint Site File Upload Size.

SharePoint Default File Upload Size:

                   By default the SharePoint web applications are allows a maximum file size of 50MB, that can be uploaded into any document library. This might be users don't want downloading 50MB files over your LAN/WAN.

How to increase the Size :

Step 1:

              1.  Goto SharePoint Central Administration -> Application Management.
           2.  In Section "SharePoint Web Application Management" -> Web application general settings.


                3. Change the Default "Maximum Upload Size" 50 MB to upto 2 GB.


                4. Click OK,
                5. Reset the IIS (Start -> Run -> iisreset).


In web.config Changes :


Problem scenario  



Solution :
              1.  Change the "httpRuntime" in section "System.web" Config value as bellow.

                   Default Value:

                  

                   // 51200 = 50 x 1024  ( 50 MB)

                        Changed Value :

                  

                   // 512000= 500 x 1024  ( 500 MB)

                  This will avoid the upload time out by adding "executionTimeout" attribute.


Windows ser 2008 & IIS 7.0 Config

                   On a Windows Server 2008 computer that has IIS 7.0-only installations, you add the maxAllowedContentLength value. When you are running Windows SharePoint Services on a Windows Server 2008-based computer that has IIS 7.0, you find that you cannot upload files that are larger than 28 MB even though you have configured the large file upload settings. 

Usually, the error that users see is "The page cannot be displayed." In some circumstances, users may also see an "HTTP 404" error.

To work around this problem,

                   set in the Web.config file for the Web application to have following settings under the section:

    *  Use Notepad to open the Web application Web.config file. By default, this file is in the following folder:

      Inetpub\wwwroot\wss\VirtualDirectories\VirtualDirectoryFolder
    *
      Add the following settings under the
 section of the Web.config file:
      
      
      
      
      
      
       

Note : "maxAllowedContentLength" is in byte :) 

Saturday, July 24, 2010

How to update the Created by & Modified by fields in Sharepoint Document library?

Scenario:-


1. While uploading the file into SharePoint Document library we need to re-assign the Created by and Modified by Column values.

2. While migrating document library .

Normally we do these process in system account (run the code block in elevated privilege), In this case the created by and Modified by field values were assigned as "System Account". How to changed to the current logged user name.

Note : There is no SDK method to update Created by and Modified by field information for existing files in a document library.

Solution :-

1. For New Upload :  .Files.Add method has parameter.
2. Update Existing Document :  Create new document and assign the existing metadata & permission, then delete the old one. ( but you will new document unique ID).


Sample Code snippet :

//Get the SPUser object for createdby user
SPUser CreatedBy = oWeb.AllUsers[CreatorLoginID] // SPContext.Current.Web.CurrentUser;

//Get the SPUser object for modifiedby user
SPUser ModifiedBy = oWeb.AllUsers[Modifier]// SPContext.Current.Web.CurrentUser;

//Open the file, read its contents and then close it
FileStream mystream = new FileStream(sFilePath, FileMode.Open);
byte[] contents = new byte[mystream.Length];
mystream.Read(contents, 0, (int)mystream.Length);
mystream.Close();

//Upload the file to library
SPFile file = _oList.RootFolder.Files.Add(sFileName, contents, CreatedBy, ModifiedBy, timeCreated, timeModified);

//Update metadata and also created and last modified datetime again
SPListItem Newitem = file.Item;
Newitem ["Title"] = strItemTitle;
Newitem ["Description"] = strItemDescription;
Newitem ["Created"] = timeCreated;
Newitem ["Modified"] = timeModified;
file.Item.Update();

Wednesday, May 26, 2010

"SharePoint:DateTimeControl" does not render styles

Problem:

       When I am using  DateTimeControl in sharepoint custom page, I found an issue in style rendering. when we click the Calendar icon, calender is display without any style, look like this




But it's works fine in default list edit forms. Reason for this issue is  Stylesheet (CSS) is not refer in Popup form (iframe.aspx).



Solution


          Copy and paste the below in  " C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\iframe.aspx" Head TAG.

      <link rel="stylesheet" type="text/css"href="/_layouts/1033/styles/datepicker.css"/> 

After adding this CSS,  DateTimeControl look like this.



Monday, February 22, 2010

How to Create and Deploy a web part in sharepoint using WSPBuilder (.wsp) ?

Introduction.

        A Web Part (also called a Web Widget) is an ASP.NET server control which is added to a Web Part Zone on Web Part Pages.

        Web Parts can be used as an add-on ASP.NET technology to Windows SharePoint Services.

Steps : 

        Following is step - step instructions as how to create a deployable WebPart (.wsp) file by using WSPBuilder.

         Before we start, please make sure you have following pre-requisites:

                1. WSPBuilder (SharePoint WSP tool) download here
                2. Microsoft.SharePoint.dll

  1. Start Visual Studio 2008.

  2. On the File menu, point to New, and then click Project.


  3. In the New Project dialog box, click Visual C# Projects -> WSPBuilder , and then select the WSPBuilder Project, Click OK.




  4. Now you got empty WSPBuilder Projcet. then Right-Click the Project select Add->New Item in popup menu. We got Add new Item dialog box, In that dialog box  select category as "WSPBuilder" and Template as "web Part Feature". Then click Add button.




  5. Now we got Feature Settings Dialog box. Which will allow you to set the Web Part Title,Description & Scope. After set those values click OK.




  Now we can see all the template files.




   Now we can explore the default files.

 






  6. Once we build the Project we got the deploy-able .wsp file.



   In Top of the solution explorer click the "show all files" Icon.


 



    Once we extract the .wsp file, It's look like this.




     Now we got deploy-able .wsp file.


Then we see How to deploy this file into Sharepoint?


  1. Copy and paste it in a common/Temp location.

  2. Register the solution file in to Sharepoint Database by using STSADM command line tool.


  3. After successful registration, we can see the solution in Central Adminstration -> Operations -> Global Configuration -> Solution Management.






  4. Click the Solution Management, we can see status as Not deployed because we registered the .wsp file, Not yet deployed.


  5. Click the Solution Link (*.wsp). We got the solution property page. In that page click the "Depoy Solution" menu and set the property based on our requirement.




  6. Click Ok and see the status of the solution.






  7. After the successful deployment we can see the feature files in Sharepoint hive Folder "12\Template\Features"








Now We can walk through, How to insert this we part in our Sharepoint Page?


  1. Goto Site Actions -> "Site Settings" page.Under"Galleries" tab click "Web Parts" link.


   




  2. Add a new web part, Click New menu in web part gallery Page.




  3. Select the newly added web part in the "New Parts Page" .








  We added our new web part in our site.

Now we see How to insert into a Sharepoint Page?


  1. Select the appropriate List, Then select "Site Actions" -> "Edit Page" .


 

  
 


  2. Click "Add a web part" link, and select our new web part from the web part template page.



  3. Click Add & see our web part added in the Sharepoint List Page.


 

 




I hope you enjoy this article.


Thank You.



Tuesday, February 9, 2010

MOSS 2007 & WSS 3 STSADM Technical Reference [ Commands ]

Introduction

          Microsoft Office SharePoint Server 2007 includes the Stsadm tool for command-line administration of Office SharePoint Server 2007 servers and sites.

          Stsadm provides access to operations not available by using the Central Administration site, such as changing the administration port. The command-line tool has a more streamlined interface than Central Administration, and it allows you to perform the same tasks. There are certain operations and certain parameters that are only available by using the Stsadm command-line tool.

          The command-line tool provides access to the complete set of Office SharePoint Server 2007 operations.


Ref :
            MOSS 2007 - STSADM Commands

            WSS 3  - STSADM Commands



MOSS 2007 Ref



WSS 3 Ref



STSADM Command Syntax & Sample Code Snippet

Ref : STSADM Syntax & Code snippet

I hope it's help full to you.


Thanks You

Monday, February 8, 2010

MS 2007 Office System Logical Architecture Diagram [ MOSS 2007 & WSS ]

Introduction

         In a single image it encompassed all the components for Windows SharePoint Services(WSS), MS Office SharePoint Server 2007(MOSS) and the various dependent components and add-on servers. Keep this handy to answer any quick question by your friend or a business user.


Ref :

Click here to download :  Visio & XPS Downloadable File formats.





MOSS 2007 Component Architecture




I hope it's helpfull to you.

Thank You

Wednesday, January 20, 2010

How to Create a Discussion Board in SharePoint?

What is the Use of Sharepoint Discussion Board?

         Discussion boards provide forums for site participants to discuss topics with each other.

        Most site templates include the ability to create discussion boards, and many sites and workspace sites have a built-in discussion board called Team Discussion.


How to Create a Discussion Board?

1. Click View All Site Content, and then click Create on the All Site Content page. or Click the "Discussions" List heading.



2. Under Communications, click Discussion Board.





3. In the Name box, type a name for the discussion board and In the Description box, type a description of the discussion board.





4. Click the Create button. then we can see the New Discussion Board




How to start a New Discussion?

 1.  In discussion Board list page , Select New -> Discussion.





2. Now we get new Discussion Post panel.



3. Click OK to POST the Discussion.





How to Reply that Discussion?

1.  Open the Discussion and click the Reply.




 2. We get the Discussion Reply panel.





3. In Body box type your message and click ok to post the message.






With few clicks we create a Discussion forum.


Thank You

Monday, January 4, 2010

How to get a file from N th - level of subfolder in a Document Library?

Objective :

             To reterive the Sharepoint files in a document from the n-th Level of Sub folder.

 Solution :

           We can achieve through "SPQuery.ViewAttributes" Property.

Steps :

          SPQuery.ViewAttributes is String property, this contains the view attributes.

         What are all View element in the View attributes :  Please Ref  -> View Elements.

         For this scenario we can use only one View attribute  (ViewAttributes = "Scope="Recursive" )

         If the Scope attribute is set to Recursive (Scope="Recursive"), the query displays all the files within a document library, including ones in subfolders. If it is set to anything else, the query displays only files in the top folder.


Code Snippet :

SPView oView = oList.Views["View_Name"];
SPQuery oQuery = new SPQuery(oView);
oQuery.ViewAttributes = "Scope=\"Recursive\"";
SPListItemCollection oSelectedItemColection = oList.GetItems(oQuery);

foreach (SPListItem oItem in oSelectedItemColection)
{
        if (oItem.File != null)
       {
              String sFileName = oItem.Name;
       }
}


Thank You

Wednesday, December 30, 2009

How to delete the bulk of Items or selective items from Sharepoint List?

Steps :

  • Open the Site -> Select the corresponding List (From which List we need to remove the Item(s)).


  • Select List Action -> Edit in Datasheet.






  • Now get the editable Grid like this






  • From the Grid we can Select Single or multiple Item(s). Then right click the selected Row -> Click "Delete Rows" from the popup Menu



  • We get a conformation message , Wherther we need to move the item to Site recyle bin.If we click "Yes" Item(s) Move to Site Recyle Bin.




  • See now the Item has removed from the Custom List to Site Recyle Bin.








Thank You