Tuesday, December 16, 2008
InfoPath Adding Image to Button ImageButton
Friday, October 3, 2008
Current configuration settings prohibit embedding username and password in the database connection string SharePoint InfoPath
Current configuration settings prohibit embedding username and password in the database connection string.)
SharePoint Central Admin -> Application Management -> Configure InfoPath Forms Services.
Check the box next to Allow embedded SQL authentication and click the OK button.
Thursday, October 2, 2008
Two InfoPath Contact Selector Controls On One Form
Say you want to add two InfoPath Contact Selector controls to one InfoPath form. This sounds simple enough, create your group and then add the Person repeating node with the DisplayName, AccountName and AccountId fields like you normally would to the Person group. Trying to duplicate this same group again for the second contact selector control will throw an error because you can't have fields or groups with the same names. But knowing that the names have to be exact to have the contact selector control work, the question arises how do we duplicate the data source for the InfoPath contact selector control.
Well assuming you have a group named grpPersonSelector bound to the first InfoPath contact selector control. Create another group named really anything we'll use grpPersonSelectorTwo. Now right click on the Person repeating group under grpPersonSelector and click Reference and choose grpPersonSelectorTwo.
That's it, now the grpPersonSelectorTwo group can be bound to your second InfoPath contact selector control. Thanks Scott for this information.
Friday, September 5, 2008
form template cannot be opened in Microsoft Office InfoPath because it contains code that requires a version of the Microsoft Common language runtime
the form template cannot be opened in Microsoft Office InfoPath because it contains code that requires a version of the Microsoft Common language runtime that is not currently installed
I searched Google and MSDN but no solutions or even mention of this problem. After watching some tv last night and installing XP SP3 on my home computer it came to me that the CLR library needs to somehow get updated or fixed. But Windows had already been repaired and Office 2007 reinstalled, that should have fixed it but nope.
Hmmm.... I got it, let's try to install .NET Framework 3.5 SP1 and see what happens. There have been improvements made to the CLR in 3.5 SP1 and should maybe update the missing dlls. Sure enough after installing 3.5 SP1 and trying to open the form again it opened without problems.
So installing the latest version of the .NET framework fixed the issue.
Tuesday, July 29, 2008
Convert InfoPath form to PDF Document
http://aspalliance.com/1466_Printing_InfoPath_2007_WebBased_Forms_to_PDF.6
The solution uses an open source project for the PDF generation called iTextSharp. I haven't tried it yet but I also don't know of a lot of free pdf libraries.
Monday, July 28, 2008
Programmatically remove InfoPath digital signature
Anyway, here is how to do it in InfoPath. Basically get the signature node, go to the signature child of that node and delete it.
XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();
if(this.Signed) //then unsign it
{
XPathNavigator xSignedSection = xnDoc.SelectSingleNode("my:myFields/my:signatures1/my:signatures2", this.NamespaceManager);
if (xSignedSection.HasChildren)
{
xSignedSection.MoveToChild(XPathNodeType.Element); xSignedSection.DeleteSelf();
}
}
Thursday, July 24, 2008
InfoPath Percentage Symbol Field
That's just wrong:
Note Microsoft Office InfoPath 2003 does not add percent symbols to numbers that are formatted as percentages. To add a percent symbol to a control's label, click where you want the percent symbol to appear, and then type %.
http://office.microsoft.com/en-us/infopath/HP010938331033.aspx
Tuesday, July 22, 2008
EmailSubmitConnection :How to add custom email to an InfoPath email data connection EmailSubmitConnection
First, you need to create a data connection (EmailSubmitConnection) that sends an email to someone within the InfoPath data connections. This data connection needs to be created so we can reference it in our code.
Second get into the code behind of the form, I'm using C# for InfoPath 2007 so those with InfoPath 2003 may have to figure this out for themselves but hopefully this gives them some clues.
Within, probably a button click event, I get a reference to the email data connection. The "email connection" is the name of the data connection I created in the first step.
EmailSubmitConnection emailDataConnection = (EmailSubmitConnection)this.DataConnections["email connection"];
//add your custom message to the introduction, say hello to yourself
XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();
XPathNavigator fullName = xnDoc.SelectSingleNode("my:myFields/my:txtFullName", this.NamespaceManager);
emailDataConnection .Introduction = "My custom introduction with some fields. Hello " + fullName.Value;
//submit the data connection which sends the email
emailDataConnection .Execute();
As you can see, just get a reference to the data connection (EmailSubmitConnection), set the Introduction property and execute. This can also be accomplished for the FileSubmitConnection and WebServiceConnection objects, so you can write code to execute these connections and set some custom properties before making the submit. Hope this helps someone.
Monday, July 21, 2008
InfoPath Rules vs Code
There is no way to switch the OoE or Order of Execution within InfoPath. Here is a sample to close the form in code in a js script code behind. There is also no need to sign the form unless the code interacts with the SharePoint OM.
Application.XDocuments.Close(0); //will close form but keep InfoPath open
Application.Quit(bool) //will exit InfoPath and if true force an exit, if false will prompt user if they want to save the form
I used true because in a rule I submit the form so the code can go ahead and quit InfoPath.
Wednesday, July 9, 2008
Enable InfoPath autocomplete feature
Within IE go to the tools menu, click Options, and then click the General tab.
Under System options, click Internet Options, and then click the Content tab.
Under Personal information, click AutoComplete.
You should be able to set your autocomplete settings from that configuration.
This came from http://office.microsoft.com/en-us/infopath/HP010967791033.aspx
Monday, July 7, 2008
InfoPath Form Template Format Structure Specification
http://download.microsoft.com/download/8/5/8/858F2155-D48D-4C68-9205-29460FD7698F/%5BMS-IPFF%5D.PDF
I wonder if they haven't had complaints about this or if there is a technical reason why -1 is hardcoded as the tabindex of that control.
InfoPath Tabbing bug - Update #1
button class="xdDTButton" title="" xd:xctname="DTPicker_DTButton" xd:innerCtrl="_DTButton" tabIndex="-1">
img title="" src="res://infopath.exe/calendar.gif"/
/button
This button is the small calendar image that when clicked opens up the date picker control. As you can see this has a tabIndex of -1 instead of the 12 that the control should have. Below is the span associated with the text portion of the date picker. Notice how that has the correct tab index.
span class="xdDTText xdBehavior_FormattingNoBUI" hideFocus="1" title="" contentEditable="true" tabIndex="12" xd:xctname="DTPicker_DTText"
MS should have made the button have a tab index of 12 too so that the next tab action goes to the next field instead of dropping down to the rest of the form.
Next question, can I change the source files without breaking the rest of the form?? What about Drop Down Lists and Radio buttons? I suspect the same thing is happening...
Remove Warning - this form is using your identity to connect to data sources
"This form is using your identity to connect to data sources"
This gets really annoying and your users may be confused. So advise them to Enable Access data sources across domains within IE -> Security Settings. The form should be within a Trusted Site or within the Local Intranet Zone so this should be ok because group policy should dictate what sites are in these zones, and if your IT group is good only very very safe sites should be in those zones, like for instance your local SharePoint intranet site.
Wednesday, July 2, 2008
InfoPath Tabbing Tab Index bug
I have an InfoPath form with controls defined below.
TextBox - Tab Index is 1
TextBox - Tab Index is 2
Date Picker - Tab Index is 3
TextBox - Tab Index is 4
TextBox - Tab Index is 0
If I tab through these fields, it goes down the line 1, 2, 3, 4, 0 as expected. However, if I tab from 1 to 2, 2 to 3 and then choose a date using the calendar and then tab again it goes down to the textbox with tab index of 0.
Why does this happen? Because the small calendar icon seems to be it's own control and gets focused on, it's tab index is presumably 0 even though the entire Date Picker control is 3. So when I tab from the calendar icon it goes to the next tab index of 0 which is expected. However, this is not an expected behavior from a user perspective or from any other perspective for that matter.
That entire Date Picker control should have a tab index of 3 not just the text portion of the control but the entire control including the small calendar icon.
This same behavior seems to occur for radio buttons and drop down controls as well. If instead you replace the Date Picker with a Drop Down control and the user selects a value, the next tab is to a control with a tab index of 0, even though it's expected that it should be 4 (using the example above).
Wednesday, June 25, 2008
The selected file was not found - InfoPath Form Services
script type="text/javascript" aspnetForm.encoding = "multipart/form-data"; /script
Tuesday, June 24, 2008
Create a Save As dialog box in InfoPath
FileDialog oDialog = new SaveFileDialog();
oDialog.DefaultExt = "xml";
oDialog.Filter = "InfoPath Form (*.xml)*.xml";
if(oDialog.ShowDialog() == DialogResult.OK)
{
string sFilename = oDialog.FileName;
this.SaveAs(sFilename);
}
InfoPath .NET Programmability
InfoPath cannot open the selected form because of an error in the form's code.The required version of the Microsoft .NET Framework 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 the required version of the Microsoft .NET Framework is installed. Or install it using Windows Update and run the Setup program again to confirm that the corresponding version of the .NET Programmability Support is installed, or contact your system administrator
Wednesday, June 18, 2008
Programmatically add InfoPath mail attachment (mime types)
Stream formStream = spItem.File.OpenBinaryStream();
System.Net.Mime.ContentType ct = new System.Net.Mime.ContentType("text/xml");
Attachment attachment = new Attachment(formStream, ct);
attachment.Name = spItem.File.Name;
mailMessage.Attachments.Add(attachment);
Hope this helps someone who is trying to do the same thing. There is an activity out on Codeplex for this but that only applies to SharePoint designer workflows. If I had time and there was a need for it, I would create a VS Workflow activity for this.
SharePoint Integration with Outlook Web Access (OWA)
There are two ways that I know of that OWA can be set up in terms of authentication either Forms based or NTLM based. I will describe the pitfalls of integrating both authentication methods with SharePoint. Most people will look to put the OWA inbox and calendar on the user's My Sites, which by all means can be done however you may want to reconsider after reading this article.
OWA Forms Based Authentication
If you try to configure the integration with Forms based you'll quickly find that the web part simply displays your OWA logon screen. In order to seemlessly integrate you will need a developer to write a Single Sign-On application (SSO) that automatically passes the user's current credentials onto the OWA logon screen. I've done it before, it's not too hard provided you know SharePoint and are good at SSO applications. But it's not for novice SharePoint developers.
NTLM Based Authentication
If you try to configure the integration with NTML based OWA you'll quickly notice that you can add the web part to the page and then you get prompted for your credentials, after entering your credentials you get passed onto OWA. There is no solution that I know of to seemlessly logon the user to OWA from SharePoint using this authentication method. And since that's the case, why not just host the entire OWA within a Page Viewer Web Part instead of having a web part for each feature of OWA and thus requiring the user to logon multiple times. In fact, instead of just hosting it within an iframe, why not just give the user a link to OWA so the page isn't crunched into an iframe with SharePoint.
Needless to say, seemless integration between OWA and SharePoint is not currently available, possible, but not like it should be.
Tuesday, June 17, 2008
Designing InfoPath forms for performance
http://blogs.msdn.com/infopath/archive/2008/05/09/designing-browser-enabled-forms-for-performance-in-infopath-forms-services.aspx