InfoPath
Microsoft InfoPath
I have had some time to ponder the ton-of-stuff at the 2009 SharePoint Conference. Overall, I really like what Microsoft has done with this version. They seem to have addressed the majority of pain points. Here are some of the highlights of what comes to mind...
Service Applications - Previously, we were forced to use the SSP service for all services (Search, BDC, Profile, Excel). Now, the Service Application approach is providing a Service Model. AC gave a level 400 session on this and built a cleverly simple load-balanced calculator that was indeed an independent service.
The Ribbon - consistency is always a good thing. The Ribbon provides...
I have started a SharePoint resource page. I have been recommending (and still do) some of the great ones out there. However, I have found that some of my experiences and needs differ in a lot of ways. As with others, my resource page has started out as something I use to personally reference in my day-to-day work routine. If it helps others that would be great too. Here's the beginnings of my MOSS SharePoint InfoPath Workflow .NET Resource Page. It will be growing significantly over the coming days.
Waynester's SharePoint Resource page
[via office.microsoft.com]
If you have access to a server that is running InfoPath Forms Services, you can design a single form template that can be used by two kinds of users — those who have Microsoft Office InfoPath 2007 installed on their computers and those who do not have Microsoft Office InfoPath 2007 installed on their computers. In the latter case, users fill out forms in a supported Web browser, not in InfoPath. If users have InfoPath installed on their computers, they can open the form in InfoPath and use the full range of form features. Users who fill out the form...
Need a good InfoPath Resource Reference?
Here's the InfoPath Forms Services Resource Center ...
http://msdn.microsoft.com/en-us/office/cc337903.aspx
[via AC]
If you can, and it's free, hook into these upcoming SharePoint developer training series:
SharePoint Developer MSDN Web Cast Series
This is in the code behind of the InfoPath 2003 Visual Studio 2005 Template. When calling the web service (covered in a previous posting) it looks like the following:
Private Sub RefreshCategories()'Set the Credentials of the web services proxy My.WebServices.Service.Url = getCurrentServiceEnvironment() My.WebServices.Service.Credentials = getUserCredentials() Dim myTempwsNode As Xml.XmlNode = My.WebServices.Service.GetCategories() Try RemoveAllFromDropDownList(thisXDocument.DOM.selectSingleNode("//my:groupCategory/my:categorycollection")) PopulateDropDownList3(myTempwsNode, _ "//my:groupCategory/my:categorycollection", _ "//my:categorydescription", _ "//my:categoryid", _ "//my:categorystatus", _ "Category", _ "CatID", _ "Active") Catch ex As Exception thisXDocument.UI.Alert(CommErrorMessage) End Try End Sub
Private Sub RemoveAllFromDropDownList(ByVal node As IXMLDOMNode) Try Dim ParentNode As IXMLDOMNode = node.parentNode 'exit routine if only one (empty) child exists If ParentNode.childNodes.length < 4 Then...
Let's say you would like to add an item to a SharePoint List. This is where CAML (Collaborative Application Markup Language) comes in. It may seem whacky at first glance, but once you get the hang of it you'll feel comfortable. Use the following code as a template and apply your personal needs:
<WebMethod()> _Public Function SubmitSharepointListItem(ByVal ListLocation As String, ByVal SharepointListID As String, _ByVal id As Integer, ByVal title As String, ByVal owner As String, _ByVal category As String, ByVal topic As String, _ByVal projecttype As String, ByVal areaofresponsibility As String, _ ByVal purpose As String, ByVal takenote As String, ByVal documentstate...
In order to pull specific column data from a SharePoint List you must structure the XML query properly. In this example, I am querying for the Category column. I have defined the SharePoint List Location and List GUID inside the Web.config file. Here is how the web method is laid out:
<WebMethod()> _Public Function GetListItemCategories(ByVal ListLocation As String, ByVal ListName As String) As XmlDataDocument If ListLocation Is Nothing Or ListLocation.Length = 0 Then ListLocation = ConfigurationManager.AppSettings("SharepointListLocation") End If If ListName Is Nothing Or ListName.Length = 0 Then ListName = ConfigurationManager.AppSettings("SharepointListGUID") End If Dim url As Uri = New Uri(New Uri(ListLocation), "_vti_bin/Lists.asmx") ...
When pulling data into InfoPath 2003 you must build it to be in a compatible format. Here's an example of a web service method providing said format from a MS SQL Server Source.
<WebMethod()> _Public Function GetCategories() As XmlDataDocument Dim conn As New SqlConnection(GetConnectString) Dim ds As New DataSet Dim cmd As New SqlCommand() cmd.Connection = conn cmd.CommandType = CommandType.StoredProcedure cmd.CommandText = "sl_Category" Dim adapter As New SqlDataAdapter(cmd) Dim result As Boolean = False Dim previousConnectionState1 As ConnectionState = conn.State Dim errMessage As String = Nothing Try If conn.State = ConnectionState.Closed Then conn.Open() End If adapter.Fill(ds) result = True Catch ex As...
I was rummaging through some old InfoPath SharePoint 2003 integration code and thought I'd share. I have moved onto MOSS 2007. Revisiting this brings back bad memories. My HOPE is that it will HELP those with the misfortune of working in those miserable conditions :o)
There will be seperate blog postings covering different aspects of what I learned.
The breakdown of code snippets are:
Building Web Services
SQL Server
SharePoint Lists
...
We have been migrating tons of content from IBM Lotus Notes to SharePoint the past 2 years. The majority of content can go over pretty smoothly. However, there may be some former Lotus Notes users who want to keep their "Notes Links" features they've come to use and depend upon. A particular site we are analyzing currently falls under this scenario.
In my research I came across a good reference of what this "Link Mania" is all about. Before you can come up with a solution or recommend an alternative it's always good to know what "it" currenty does.
Here's some references I found:
Notes...
Deploying an InfoPath 2007 Form that contains Managed Code to a Browser-Enabled WSS v3 Library can be done. Trying to find the How To in some of the recommended top books on the subject? Good luck! Josh Meyer explains it (free of charge) in a step-by-step approach at the following web site:
http://geekswithblogs.net/jgmeyer/archive/2006/06/26/83087.aspx
I just ordered copies of two books off Amazon related to InfoPath 2007 and MOSS Workflow. We have a major project inside the corporation we are ramping up. My fellow coworkers, Scott Hankins & Marcel Janda, will be working together to make this happen. Scott already purchased these and I got a chance to glance over them at lunch yesterday. They look worthwhile and are from solid authors. Here's a link reference if you are interested...
This is a boon for InfoPath developers out there! I caught this over at Jan Tielens' blog. It's concerning the use of newly introduced Universal Data Connection (UDC) files. In previous postings I ranted about the lack of (or pain of) accomodations for distributed solutions in InfoPath. I found myself creating data sources in development that were difficult to change when migrating to Testing or Production environments. Jan does a swell job of explaining this new approach. He also throws in some upgrade and migration tips.
External Data & InfoPath: Server Upgrade and Migration Tool
I recently came across an unexpected error a user got when attempting to run an InfoPath 2003 SP2 VS 2005 Managed Code Solution. The error was this:
InfoPath cannot open the selected form because of an error in the form's code.
The Microsoft .NET Framework 1.1 is not installed on your computer or the InfoPath primary interop assembly (PIA) is not registered. Use Add or Remove Programs in Control Panel to make sure that Microsoft .NET Framework 1.1 is installed or install it using Windows Update, then run Setup again to confirm that .NET Programmability Support is installed, or contact your system...
Yesterday, I posted an entry about the BackgroundWorker class and how it helped me out recently. I also mentioned that I uploaded bulk documents into a SharePoint Form Library. I thought I'd share a piece of code that made this task easy.
For Each foundFile As String In My.Computer.FileSystem.GetFiles( _ My.Computer.FileSystem.CurrentDirectory, _ FileIO.SearchOption.SearchAllSubDirectories, "*.xml")
'this line used to see status monitoring - adjust to your needs Thread.Sleep(2000)
Dim foundFileInfo As New System.IO.FileInfo(foundFile)
Me.ToolStripStatusLabel1.Text = "Uploading " & foundFileInfo.Name
Dim webClient As New System.Net.WebClient()
webClient.Credentials = System.Net.CredentialCache.DefaultCredentials
Try
webClient.UploadData("http://abcd.domain.com/C7/SharePoint Site Name/Form Library Name/" + foundFileInfo.Name, "PUT", GetFile(foundFileInfo.FullName))
Catch ex As Exception
End Try
Next
MsgBox("Upload Complete!")
Recently I was tasked with writing a quickie application that would convert a Custom List in SharePoint to an InfoPath Form Library. While I was looking around at all the new class libraries in .Net 2.0, I happened across the BackgroundWorker Class (System.ComponentModel). This proved to be just the ticket for what I was wanting to do, an asynchronous approach of processing a mass load of documents. Here's a 10K view of what I did:
Private Sub convertButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles convertButton.Click
Me.BackgroundWorker1.RunWorkerAsync(750)
End Sub
Private Function Convert( _ ByVal bw As BackgroundWorker, _ ByVal sleepPeriod As Integer)...
If you are known to answer (like moi), “Oh, I've read some code in MSDN magazine” or “I remember a presentation a few months ago” when asked if you know XML - this bit of advice is for you. Don't even attempt to convince others you know if you haven't “been there, done that” with a bonafide project. And let me tell ya, InfoPath is a great development platform to get experience. Somewhere in that experience you'll have a light-bulb moment like Andy Stitzer (from The 40 Year Old Virgin) when he had his chest hair pulled out and yells, “Yooooooooow,...
[via Philo]
It took me a while to figure out how to do the InfoPath/webservice thing starting with an InfoPath form. Maybe this is blindingly obvious to everyone but me, but here it is anyway
Check out the entire post ...Creating a web service for an InfoPath form in 25 easy steps
[via MSDN]
I wish I would have stumbled upon this sooner. Over at MSDN there is a Book Excerpt named Advanced Form Design that goes in-depth on how to manipulate File Attachments with managed code. It has some excellent examples. One particullary nice example that I plan on using is the ExecuteAction method:
The following Visual Basic code-behind function adds a new item in a repeating table or section and then opens the File Attachment dialog box for an attachment in that section. If the user cancels the File Attachment dialog box, the code removes the inserted row.
You can find this excerpt at the...
Recently I posted about an experience I had with deploying an InfoPath Managed Code solution to a testing environment. It was called...
InfoPath: Handling Data Connections Pointing To Web Services Dynamically For Development Production
... and I expressed my displeasure of finding out that the WSDLURL property was Read Only and me having so many references to web services that seemed unchangeable. I referred to a solution back then BUT I found an even better solution and a whole lot more information about using web services inside InfoPath.
This will save you a lot of time. Start here before you do any coding...
Developing Solutions with...
Since I've been working with InfoPath 2003 SP2 and VS 2005 Managed Code I've been working with XML data quite a bit. Scott Hanselman has a thought and suggestion on a useful method / performance philosophy (I agree)...
[via Scott Hanselman]
Random thought: I like the whole XmlReader philosophy. I use it much more often than XmlDocument. I haven't made an XmlDocument in a while. Every once in a while an XmlDocument shows up when you need an XmlNode for some SOAP stuff, but for the most part, I like XmlReaders.
Read the entire post at...
XmlTextReader more and more
It would appear that InfoPath wasn't cut out for an Enterprise Deployment Strategy. When I started looking to place my solution out on our testing environment I realized there were a lot of web services pointing to my local development box. And the WSDLURL property is Read Only - aargh! But there is hope. At least that's what I see over at InfoPathDev's Forum thread called Updating Data Connections During Deployment.
David Crabbe states that you can access a property inside the IXMLDOMDocument via IXMLDOMDocument3 interface to change the serviceUrl attribute. If you place this value somewhere on your main schema you...
Here's a little diddy that I find used often when wanting to pass xml data From / To InfoPath Managed Code and other interfaces such as Web Services...
Private Function ConvertNodeToSystemXML(ByVal node As IXMLDOMNode) As Xml.XmlNode
Dim xmlAsString As String = node.xml
Dim document As Xml.XmlDocument = New Xml.XmlDocument()
document.PreserveWhitespace = True
document.LoadXml(xmlAsString)
Return document.DocumentElement
End Function
Private Function ConvertNodeToMsXML(ByVal node As Xml.XmlNode) As IXMLDOMNode
Dim xmlAsString As String = node.OuterXml
Dim document As IXMLDOMDocument = thisXDocument.CreateDOM()
document.preserveWhiteSpace = True
document.loadXML(xmlAsString)
Return document.documentElement
End Function
For the C# translation you can refer to the following link...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ip2003_ta/html/ODC_INFDigitallySigningData2.asp
When it comes to deploying your InfoPath 2003 Managed Code Solution with Full Trust, it is best to use the RegForm command line utility to create an MSI file. For Visual Studio 8 (VS 2005) I found the RegForm utility embedded in my c:\Program Files\Microsoft Visual Studio 8\Visual Studio Tools For Office\INFOPATH subfolder.
In order to make it Fully Trusted you can execute the RegForm command like such:
RegForm /U urn:myForm:myCompany /T Yes /MSI C:\Projects\InfoPathProjectFolder\InfoPathApp.xsn
This produces a file called InfoPathApp.msi ready for user installation.
For a more in-depth article, refer to Understanding Fully Trusted Forms [InfoPath 2003 SDK Documentation
Found this on Andrew Connell's blogsite...
Things to note:
A new client SKU named Microsoft Office Enterprise 2007 is what you know as Office Professional Plus 2007 (including Excel, Outlook, PowerPoint, Word, Access, InfoPath, Communicator, & Publisher) but also includes Microsoft Office Groove 2007 & Microsoft Office OneNote 2007.
Office SharePoint Server 2007 includes publishing, collaboration & search. In today’s terms, think SharePoint Portal Server & SharePoint’s Shared Services, and Content Management Server.
Office Project Server 2007, Office Project Portfolio Server 2007, Office Forms Server 2007 (think webified InfoPath), and Office Groove Server 2007 are separate SKU’s from Office SharePoint Server 2007....
[via InfoPathDev.com]
One very useful feature of Microsoft SharePoint is its ability to create and maintain lists that users can leverage to store, view, and share items with other users of the SharePoint site. It is often desirable to be able to view these items and to add additional items with an InfoPath form; one such example is a list of contacts. In this example we will add items to the automatically generated Contacts list in SharePoint, but this technique can be used to add list items to any SharePoint list.In this task we will add three data connections to a...
This is a very well written article on InfoPath. I've included some things that really stood out to me below.
[via Sébastien Bouchet]
In a nutshell, InfoPath is both a form design environment allowing a form designer to create form templates, and a client viewer allowing a business user to fill out a form based on a template. Nothing really new : after all, Acrobat forms, Word-based forms have allowed us to do this for a long time. What's so sexy about InfoPath is that it is both standards-based (a form template is associated to a particular XML Schema definition, and all...
[via InfopathDev.com]
To display your InfoPath form data in a Web page, you can write XSL to translate your form into HTML. With a little knowledge of XSL this is a straightforward task. To display the contents of a rich text field you must use xsl:copy-of instead of xsl:value-of. This allows the XHTML content to be displayed in the Web page.
But you will quickly discover that this works for everything in a rich text field except pictures. This is because InfoPath stores pictures using base64 encoding, and then embeds the resulting string directly into the XML content...
If you need solid example...
[via Scott Hillier]
Solutions that automate business processes are becoming increasingly common, and the combination of SharePoint, InfoPath, and Visual Studio 2005 definitely streamlines the development process. In fact, the special relationships between these technologies make them an ideal platform for developing process-based solutions. A similar solution developed in ASP.NET, for example, would take considerably longer to create and deploy. That's why I think you'll see more and more solutions built on the Office System in the next few years.
This is an excellent article by Scott Hillier on integrating InfoPath, Excel, and Sharepoint. It has some great infopath coding examples too. Check...
[via Patrick Tisseghem]
Some time ago, I had the opportunity to have a talk at the Belgium MSDN community regarding opportunities for .NET developers to extend the Windows SharePoint Services. In addition to the Web Part development (see also my 2 articles on building Web Parts), and the access to the SharePoint object model and related XML Web Services, I demonstrated how to create document event handlers in VS.NET that hook up to a SharePoint form library. The goal of the .NET code was to process the incoming InfoPath XML. In this article I provide an overview of how to accomplish...
[via Microsoft TechNet]
Here are some links for frequently asked questions related to Microsoft InfoPath 2003...
InfoPath General Information
InfoPath vs. Other Tools
InfoPath and Standards
InfoPath 2003 Edit Mode
InfoPath Design Mode
InfoPath Deployment
InfoPath Technical Resources
[via Scott Robinson]
It's easy to look at Microsoft's InfoPath 2003 as a frivolous add-on to Office 2003 (specifically the Enterprise Edition, which includes InfoPath). It's hard to believe that something that seems an extra, dropped into a desktop product suite like a basket of breadsticks at an Italian restaurant, can be a powerful and flexible desktop application tool. Designed for the not-particularly-technical, it does not appear at face value to be particularly powerful—and therefore not particularly useful to the enterprise-minded developer.
But InfoPath will surprise you, not only with its considerable fundamental capabilities but with the added utility and features beneath...
[via InfoPathDev]
When filling out a form with several different sections it is very convenient to use tabs to separate these sections. Tabs quickly and easily let the user know what sections are available and have become a vital part of graphical user interfaces. Using advanced design techniques, InfoPath can be used to create a fantastic and appealing tabbed interface.
In this task we will use a layout table, buttons with code, and three views to create a tabbed content pane. Let's start by creating a new blank form.
Read the detailed article at the following link...
Create a Tabbed Content Pane
[via Gary Devendorf by way of Patrick Tissenghem's Blog]
Here's a 7 minute Movie showing how to create an Infopath form that Reads, Edits, Deletes, and Creates Notes documents via Web Services with no code (8.5 meg)
InfoPath <--> Notes
As you might have gathered from recent postings my current project entails integrating InfoPath with Sharepoint. One major requirement is manipulating Sharepoint List Items. Andrew Connell came across a posting by Ryan Rogers called...
Adding New List Items Using the Lists.asmx Web Service
The approach requires the use of CAML (Collaborative Application Markup Language) XML Batches. I plan on posting an article (in the near future) on my experiences with integrating InfoPath and Sharepoint complete with example source code - be looking for it. Until then, I'll reference my previous findings up to this point...
InfoPath: Best Practices for Building Enterprise Solutions
InfoPath: How To Populate a...
If you weren't able to attend TechEd 2005 and are looking for some Best Practice Training on InfoPath development for Enterprise Solutions I found a place where you can pull it down.
It is best if you have a broadband connection when Playing the session... here it is...
http://microsoft.sitestream.com/teched2005/CLI/CLI333_files/Default.htm
If you are interested in other Sharepoint Sessions you can find them over at...
http://www.wssdemo.com/Pages/TechED2005.aspx?menu=Resources
[via Jan Tielen]
Jan does a great job of stepping you through how to access Sharepoint's Users via Web Services and populating an InfoPath drop-down list.
Requirements:
InfoPath 2003
Visual Studio 2003
InfoPath 2003 Toolkit for VS 2003
access to a Sharepoint installation
You can find the entire article by going to the following link...
InfoPath: How To Populate a List Control With SharePoint Users
[via InfoPath Team Blog]
I found a great reference on How To handle offline data with InfoPath and synching (synchronizing) the offline InfoPath Form Data to a Sharepoint Services Form Library upon reconnection or being online.
Scenario :User fills out forms for a particular form template while the laptop is disconnected from the network. Upon reconnection, seamlessly synchronize the offline forms to a Windows SharePoint Services form library. Solution: Using OnSubmitRequest, you can have the code save to the offline folder depending on if we're offline or not, as in the following code, which is written in C# using our Visual Studio...
[via Westin]
How to create a link to launch an InfoPath Form in order to fill out a Form Library in Sharepoint. Westin recommends using FrontPage 2003 to edit the page on which you would like the link to appear, add a form library web part to the page, convert it to an XSL data view, delete everything but the “Fill Out This Form” toolbar element and then change the wording of the hyperlink to your choosing.
see the full posting here...
Fill Out an InfoPath Form Library From a Link On Another Page
Another related posting...
Launch an InfoPath form from a SharePoint page...
[via Westin]
Systems know who you are, but SharePoint and/or InfoPath solutions rarely take advantage of that awareness. Here is an easy way to create a more personalized experience for your users using built-in functionality of InfoPath and SharePoint.
Read the full details at:
Using InfoPath and SharePoint to Create Personalized Views
[via MSDN]
Here's a good starting point direct from the creators themselves...
InfoPath 2003 is a new application in the Microsoft Office System that can help you gather information flexibly and efficiently in rich, dynamic forms. You can more effectively share, reuse, and repurpose information throughout your team or organization—improving collaboration and decision-making to positively impact your business.
You'll find in-depth content, code walkthroughs, downloads, product information, and more at this one-stop resource for InfoPath developers.
Technical Articles
Developer Documentation
Training
Downloads
Last, but certainly not least --- Essentials
Find it all here by clicking --> InfoPath 101 <--
I was looking for some solid examples of InfoPath and Sharepoint integration to help expedite my learning curve with my current project at work. I found a site through msdn newsgroups:
InfoPath Lookup of List Data
The Definitive ADVANCED book on MCMS is here!
Advanced Microsoft Content Management Server Development
One of the co-authors, Andrew Connell, announces the release on his blog here and gives his personal perspective on his first writing experience. The content in this baby looks phenomenal! A MUST for all Microsoft CMS developers. Congratulations AC, Angus, Mei Ying and Stefan! I can't wait to get my hands on it.
The Advanced...
The Predecessor...
[via InfoPathDev.com]
If you need to learn some clever search functionality within InfoPath, the guys over at InfoPathDev have free samples on aisle 9 --- for your downloading pleasure.
Techniques Demonstrated:
Use XPath to search a data source, including Rich Text controls, for user-specified query string.
Store search results in secondary data source (allows for complex manipulation).
Manipulate a secondary data source via code.
Disable view switching via the menus.
String object extensions.
It's called Search, v1.0
[via InfoPathDev]
Check out Greg Collins How-To article related to InfoPath Data Validation. I'm finding this Sharepoint / InfoPath marriage to be an alright setup. But there's much more to dig into.
You might have a button in your form—such as a submit button—that you want to prevent the user from being able to click until all required form fields are filled in. This can be done using conditional formatting. The complexity of the conditional formatting depends on your form.
» Disable a Button Until All Required Fields are Filled In
via [InfoPathDev]
Check out Jim Cantwell's HOW TO article on passing parameters to InfoPath Forms. It has complete code examples and is very insightful.
There is sometimes the need to pass arguments to InfoPath when opening a form. You either want to switch to a specific view, or maybe want to turn on a diagnostic feature in your code. By leveraging the merge functionality of InfoPath, you can pass simple arguments or a complex set of data to your form.
Define A Parameters Schema
Enable Merge Functionality
Add OnMergeRequest/OnAfterImport Code
Test Your OnMergeRequest/OnAfterImport Code
Opening a Document and Passing Parameters From a Web Page
» Pass...
I'm currently working on a project that is at the technical design stage. Initially, I was planning on coding it as a custom ASP.NET application due to the requirements. However, with the customer wanting to utilize Sharepoint and going over the functional documentation with some co-workers numerous times I may have changed my direction. Andrew Connell (AC) suggested we consider looking at InfoPath and integrating it into Sharepoint.
So, I'm up late tonight doing some research before we speak with the customer tomorrow afternoon. And I come across this article on Microsoft's site:
» Integrating Microsoft SharePoint Products and Technologies and Microsoft Office InfoPath 2003
It seems to...