Tags » Infopath

Fix for the error "Activation could not be completed because the InfoPath Forms Services support feature is not present"

I had developed a simple workflow in Sharepoint Designer 2010. I got this error when I tried to publish the workflow into my MOSS 2010 site. 125 more words

MOSS 2010

Solution to stuck up InfoPath form deployment

When form is stuck on deployment then : first stop the Sharepoint Administration Service in Services.msc

After that – cancel the deployment of that form by the following command… 81 more words

SharePoint2010

InfoPath: How to restrict users to input numbers with correct format?

Situation

For example, I have a compensation leave registration form to allow users to record holiday work date and hours. Here is the form:

In the form, user input staff ID to check their current CL balance (in terms of hour), then selects the holiday work date. 106 more words

Library

Checking duplicate records in repeating table of Infopath

While creating infopath form I am facing problem when I want to put validation in repeating section,

Here I have an requirement that validation should fire when same date is repeat again in repeating section, below is the solution I found after long research which may help you too : 58 more words

Infopath2010 Forms

Using eval function for people picker in InfoPath

Display Name of Multi Selection People Picker:

substring(eval(eval(Person, ‘concat(pc:DisplayName, “, “)’), “..”), 1, string-length(eval(eval(Person, ‘concat(pc:DisplayName, “, “)’), “..”)) – 2)

Display Account IDs of Multi Selection People Picker. 22 more words

Infopath

Serialize and Deserialize InfoPath form and extract the attachment using WebClient in C#

Hi,

Suppose this is our InfoPath form

First we will generate the class for the above InfoPath form

http://nishantrana.me/2014/07/13/generate-a-c-class-from-an-infopath-form/

The sample code


myFields invoice = null;
WebClient webclient = new WebClient();
webclient.UseDefaultCredentials = true;

using (Stream fileStream = webclient.OpenRead("http://server:5000/formlibrary/FirstForm.xml?NoRedirect=true"))
{
if (fileStream != null)
{
XmlTextReader reader = new XmlTextReader(fileStream);

reader.Read();
reader.MoveToContent();

XmlSerializer xser = new XmlSerializer(typeof(myFields));
myFields invoiceInfopath = (myFields)xser.Deserialize(reader);
byte[] b = invoiceInfopath.field2;

// filename
int nameBufferLen = b * 2;
byte[] fileNameBufffer = new Byte;

for (int i = 0; i < nameBufferLen; i++)
{
fileNameBufffer[i] = b;
}

char[] charFileName = UnicodeEncoding.Unicode.GetChars(fileNameBufffer);
string fileName = new string(charFileName);
fileName = fileName.Substring(0, fileName.Length - 1);

// attchment
byte[] fileContent = new byte;

for (int i = 0; i < fileContent.Length; i++)
{
fileContent[i] = b;
}

FileStream fs = new FileStream(@"C:\test\" + fileName, FileMode.Create);
fs.Write(fileContent, 0, fileContent.Length);
fs.Close();
}

… 11 more words
C#

How to Read the InfoPath content and extract the attachment using XMLDocument in C#

The InfoPath form:-

The namespace and the field1 that is node that contains the attachment

Sample Code:


XmlDocument myDoc = new XmlDocument();
myDoc.Load(@"C:\test\form.xml");

// specify the name space
XmlNamespaceManager ns = new XmlNamespaceManager(myDoc.NameTable);
ns.AddNamespace("my", "http://schemas.microsoft.com/office/infopath/2003/myXSD/2014-07-12T15:29:09");

// the node that contains the attachment
XmlNodeList nl = myDoc.SelectNodes("/my:myFields/my:group1/my:group2/my:field1", ns);
foreach (XmlNode n in nl)
{
string s = n.InnerText;
byte[] b = Convert.FromBase64String(s);
int nameBufferLen = b * 2;

// file name buffer to get the filename with extension
byte[] fileNameBufffer = new Byte;

for (int i = 0; i < nameBufferLen; i++)
{
fileNameBufffer[i] = b;
}
char[] charFileName = UnicodeEncoding.Unicode.GetChars(fileNameBufffer);
string fileName = new string(charFileName);
fileName = fileName.Substring(0, fileName.Length - 1);

// byte array for the remaining content
byte[] fileContent = new byte;

for (int i = 0; i < fileContent.Length; i++)
{
fileContent[i] = b;
}

FileStream fs = new FileStream(@"C:\test\" + fileName, FileMode.Create);
fs.Write(fileContent, 0, fileContent.Length);
fs.Close();

}

… 15 more words
.NET Framework