Archive

Archive for April, 2010

MOSS Infopath


Writing CAML Queries For Retrieving List Items from a SharePoint

http://sharepointmagazine.net/technical/development/writing-caml-queries-for-retrieving-list-items-from-a-sharepoint-list

Infopath Validations
if (e.Operation == XmlOperation.Insert || e.Operation == XmlOperation.ValueChange)
{
//Clear any previous errors for this node. If there are no errors, just catch
//the error that is generated and then move on.
try
{
this.Errors.Delete(“Invalid Value”);
}
catch (Exception ex) { }

//Set the valAge variable to the value that is entered in the Age field.
int valAge = Convert.ToInt32(e.Site.Value);

//If the value that is entered in the Age field is less than 30 or
//greater than 65, add a passive error to the collection of the error.
if ((valAge 65))

{
this.Errors.Add(e.Site, “Invalid Value”, “The value of the ”
+ e.Site.LocalName + ” field must be greater than 30 and less than 65.”);
}
}

Validations
————-
string xpath = “/my:myFields/my:field1”;
XPathNavigator field1 = MainDataSource.CreateNavigator().SelectSingleNode(xpath, NamespaceManager);
string oldValue = field1.Value; // Read
// field1.SetValue(“New Value”); // Write
if (string.IsNullOrEmpty(oldValue))
{
System.Windows.Forms.MessageBox.Show(“Hello, World”);
}

if (e.Operation == XmlOperation.Insert || e.Operation == XmlOperation.ValueChange)
{
//Clear any previous errors for this node. If there are no errors, just catch
//the error that is generated and then move on.
try
{
this.Errors.Delete(“Invalid Value”);
}
catch (Exception ex) { }

//Set the valAge variable to the value that is entered in the Age field.
string valEmp =e.Site.Value;

////If the value that is entered in the Age field is less than 30 or
////greater than 65, add a passive error to the collection of the error.
//if ((valAge 65))
//{
// this.Errors.Add(e.Site, “Invalid Value”, “The value of the ”
// + e.Site.LocalName + ” field must be greater than 30 and less than 65.”);
//}
//If the value that is entered in the Age field is less than 30 or
//greater than 65, add a passive error to the collection of the error.
if (string.IsNullOrEmpty(valEmp))
{
System.Windows.Forms.MessageBox.Show(“Hello, World”);
}
}

How to use the SharePoint object model to submit data from an InfoPath browser form to a SharePoint list
http://www.bizsupportonline.net/browserforms/how-to-use-sharepoint-object-model-submit-data-infopath-browser-form-sharepoint-list.htm

How to submit the rows of a repeating table in InfoPath to a SharePoint list
http://www.bizsupportonline.net/infopath2007/how-to-submit-items-rows-repeating-table-infopath-sharepoint-list.htm

How to use a SharePoint ItemAdded event handler and the object model to submit data from an InfoPath form to a SharePoint list
http://www.bizsupportonline.net/infopath2007/how-to-use-sharepoint-event-handler-object-model-submit-data-infopath-form-sharepoint-list.htm

How to use the SharePoint object model to submit data from an InfoPath browser form to a SharePoint list
http://www.bizsupportonline.net/browserforms/how-to-use-sharepoint-object-model-submit-data-infopath-browser-form-sharepoint-list.htm

Infopath Download
http://www.informit.com/store/product.aspx?isbn=0321410599

Submitting Data from InfoPath 2007 to a SharePoint List
http://msdn.microsoft.com/en-us/library/cc162745.aspx

For further and comprehensive information regarding data connections in InfoPath, see http://office.microsoft.com/en-us/infopath/HP012304861033.aspx?pid=CH100598301033

For more information specific to data connections to Web Services, see http://office.microsoft.com/en-us/infopath/HP100913971033.aspx?pid=CH100598301033

For more information on using InfoPath with Access, see http://office.microsoft.com/en-us/infopath/HP100950831033.aspx?pid=CH100598301033

For more information on using InfoPath to connect to SharePoint data sources, see http://office.microsoft.com/en-us/infopath/HP100931601033.aspx?pid=CH100598301033

For general topics of interest and further How To information on InfoPath data connection, see http://office.microsoft.com/en-us/infopath/CH100598301033.aspx

Add a data connection to a SharePoint document library or list
http://office.microsoft.com/en-us/infopath/HP100931601033.aspx?pid=CH100598301033

http://office.microsoft.com/en-us/infopath/CH100598301033.aspx

Active Directory User Data Web Service Platform Component
http://msdn.microsoft.com/en-us/library/aa203051(office.11).aspx

Adding User Information from Active Directory Domain Services to InfoPath 2007 Forms
http://msdn.microsoft.com/en-us/library/bb952744.aspx

Lab 1: Publishing an InfoPath 2007 Form Template to a Server Running InfoPath Forms Services
http://msdn.microsoft.com/en-us/library/bb267334.aspx

Importing Data from AD to InfoPath 2007 Form Template (Code free)
http://kwizcom.blogspot.com/2007/11/importing-data-from-ad-to-infopath-2007.html

InfoPath – Get the current user without writing code
http://blogs.microsoft.co.il/blogs/itaysk/archive/2007/04/05/InfoPath-_2D00_-Get-the-current-user-without-writing-code.aspx

How to Emulate User Roles in InfoPath Forms Services to Automatically Switch Views
http://sharepointsolutions.blogspot.com/2009/04/how-to-emulate-user-roles-in-infopath.html

How to auto populate InfoPath forms using the people picker
http://www.petestilgoe.com/2010/01/how-to-auto-populate-infopath-forms-using-the-people-picker/

Data binding between Document Information Panel and Word document
http://blogs.msdn.com/infopath/archive/2006/11/06/data-binding-between-document-information-panel-and-word-document.aspx

custom-sharepoint-web-service-upload
http://www.k2distillery.com/2009/02/custom-sharepoint-web-service-upload.html

GOOD

InfoPath form Services – implementing a Master-Detail on the web
http://www.sharepoint-tips.com/2007/01/infopath-form-services-implementing.html
http://blogs.msdn.com/infopath/archive/2007/03/26/submitting-to-a-sharepoint-list.aspx
http://grounding.co.za/blogs/romiko/archive/2009/09/24/integrating-infopath-forms-using-xmlformview-control-with-aspx-pages.aspx

InfoPath – Get user information without writing code (extended)
http://claytoncobb.wordpress.com/2009/06/21/userprofileservice-extended/

http://aspadvice.com/blogs/jfuentes/archive/2008/10/11/InfoPath-and-MOSS-2007-Useful-Links.aspx

Embedding InfoPath Form in SharePoint Page
http://elczara.spaces.live.com/blog/cns!554EC06D366AC9D5!186.entry

Submit repeating table rows from InfoPath to a SharePoint list using the SharePoint Object Model
http://www.bizsupportonline.net/blog/2008/12/submit-repeating-table-rows-from-infopath-to-sharepoint-list-using-sharepoint-object-model/

Infopath -Submitting to a SharePoint List
http://www.doubelclick.com/Lists/Announcements/DispForm.aspx?ID=116

http://www.infopathdev.com/

MOSS
How to Create a Thumbnail Picture Library View in SharePoint 2007

http://www.endusersharepoint.com/2009/01/23/how-to-create-a-thumbnail-picture-library-view-in-sharepoint-2007/

How to Optimize a SharePoint Server 2007 Web Content Management Site for Performance
http://msdn.microsoft.com/en-us/library/bb727371.aspx

Adding a Custom View Style to MOSS 2007 or WSS3
http://www.novolocus.com/2008/09/18/adding-a-custom-view-style-to-moss-2007-or-wss3/

SharePoint Branding – How CSS works with master pages – Part 1
http://www.cleverworkarounds.com/2007/10/08/sharepoint-branding-how-css-works-with-master-pages-part-1/

Customizing and Branding Web Content Management-Enabled SharePoint Sites (Part 2 of 3): Extending WCM
http://msdn.microsoft.com/en-us/library/aa830815.aspx

SharePoint Data View Part Magic and Search
http://blogs.msdn.com/arpans/archive/2007/07/27/sharepoint-data-view-part-magic-and-search.aspx

Teach the Content Query Web Part how to display a link list
http://www.sharepoint-tips.com/2007/01/teach-content-query-web-part-how-to.html

http://www.codegain.com/articles/sharepoint/suaoperation/learning-experience-moss-2007-step-by-step-part6.aspx

Solution Development in SharePoint 2007 Part 5
http://wss.made4the.net/archive/2008/06/07/solution-development-in-sharepoint-2007-part-5.aspx

Customizing the Quick Launch menu: Adding fly-out menus to SharePoint navigation
http://blogs.msdn.com/sharepoint/archive/2007/04/26/customizing-the-quick-launch-menu-adding-fly-out-menus-to-sharepoint-navigation.aspx

How to: Customize the Display of Quick Launch
http://msdn.microsoft.com/en-us/library/ms466994.aspx

Submit Infopath From Using web services
———————————————–

public void FormEvents_Loading(object sender, LoadingEventArgs e)
{

string CurrentUserName = System.Environment.UserName;

XmlNamespaceManager xnManager = this.NamespaceManager;
XPathNavigator xnMainDataSource = this.MainDataSource.CreateNavigator();

XPathNavigator xnRequestedBy = xnMainDataSource.SelectSingleNode(“/my:myFields/my:Requested By”, xnManager);
try
{
//below code is the find the full name of the user using FQN
DirectorySearcher UserNameSearch = new DirectorySearcher(“(mailNickName= ” + CurrentUserName + “)”);

SearchResult mYResult = UserNameSearch.FindOne();
if (mYResult == null)
{
xnRequestedBy.SetValue(“Sorry User is not available”);
}
else
{
DirectoryEntry EmployeeName = mYResult.GetDirectoryEntry();
//adding user’s full name to the infopath form
xnRequestedBy.SetValue(EmployeeName.Properties[“givenName”].Value.ToString() + ” ” + EmployeeName.Properties[“sn”].Value.ToString());

}
XPathNavigator xnToday = xnMainDataSource.SelectSingleNode(“/my:myFields/my:Today”, xnManager);
xnToday.SetValue(System.DateTime.Today.ToShortDateString());
}
catch (Exception ex)
{
throw ex;

}
}

public void FormEvents_Submit(object sender, SubmitEventArgs e)
{

try
{
XmlNamespaceManager xnManager = this.NamespaceManager;

XPathNavigator xnMainDataSource = this.MainDataSource.CreateNavigator();

XmlDocument MyDocument = new XmlDocument();

XmlElement NewListBatch = MyDocument.CreateElement(“Batch”);
NewListBatch.SetAttribute(“OnError”, “Continue”);

XPathNavigator xnRequestedBy = xnMainDataSource.SelectSingleNode(“/my:myFields/my:RequestedBy”, xnManager);
XPathNavigator xnToday = xnMainDataSource.SelectSingleNode(“/my:myFields/my:Today”, xnManager);
XPathNavigator xnIssue = xnMainDataSource.SelectSingleNode(“/my:myFields/my:Issue”, xnManager);
XPathNavigator xnPartNumber = xnMainDataSource.SelectSingleNode(“/my:myFields/my:PartNumber”, xnManager);
XPathNavigator xnAssemblyPN = xnMainDataSource.SelectSingleNode(“/my:myFields/my:AssemblyPN”, xnManager);
XPathNavigator xnProblemDescription = xnMainDataSource.SelectSingleNode(“/my:myFields/my:ProblemDescription”, xnManager);
XPathNavigator xnComments = xnMainDataSource.SelectSingleNode(“/my:myFields/my:Comments”, xnManager);

NewListBatch.InnerXml = “” +
“” + xnRequestedBy.Value + “” +
“” + xnToday.Value + “” +
“” + xnIssue.Value + “” +
“” + xnPartNumber.Value + “” +
“” + xnAssemblyPN.Value + “” +
“” + xnProblemDescription.Value + “” +
“” + xnComments.Value + “” +
“”;

// Web reference –http://spserver:Port/_vti_bin/lists.asmx

// Admin access
PrinterListsService.Lists SPLists = new PrinterListsService.Lists();
SPLists.Credentials = new NetworkCredential(“User ID”, “Passwird”, “Domine”);
XmlNode NewListNode = SPLists.UpdateListItems(“Form Library”, NewListBatch);

}
catch (Exception ex)
{
throw ex;
}

e.CancelableArgs.Cancel = false;
}

Categories: Uncategorized Tags: , ,

Infopath Views with sharepoint

Categories: Uncategorized

create new view in sharepoint list

How to add a Site Template to the Site Definitions List in MOSS


It’s easy enough to create a new site template in SharePoint, but these templates can only be saved in the top level web sites template gallery and applied to sub sites only.

To add a new option to the list of choices when creating a top level website you need to create a “Site Definition”.
This is a far more difficult task but there is a way you can add a site template file (.stp) to the list of Site Definitions using the stsadm.exe command line utility:

1. Create a MOSS Site
2. Click on “Site Settings” at the top of the page.
3. under the “Look and Feel” heading click on “Save site as template”
5. Give the template a File Name, Title and Description. Also select if you want the content of the template site included (documents etc).
6. Click “OK”
7. on the following page click on the “site template gallery” link
8. Right click on the name of the template and select “Save target as”
9. Save the file to your local computer
10. Copy the file to your Front end web server (preferably onto your c:\ drive)
11. Click on Start > Run and type “cmd” then hit “Enter”
12. Change to the following directory in the command prompt window:
c:\program files\common files\microsoft shared\web server extensions\12\bin
13. Type the following command:
stsadm.exe -o addtemplate – filename “c:\sitetemplate.stp” -title “Site Template”
14. Hit “enter”
15. Type “iisreset” and hit enter

Now your site template will appear in the site definitions list when creating a new top-level website.
Go Custom Template
Your new site will be available select that

Categories: backup

Infopath Links

Categories: Infopath forms

Sql server 2008

Categories: SQL

Indexing and Searching PDFs in MOSS 2007

Categories: MOSS Search