Archive for InfoPath

While I’m here…….

Posted in InfoPath, SharePoint, Snippets with tags , , , , , , , on April 25, 2008 by Si

I remembered a couple of other little SharePoint snippets that I have found useful.

  1. Want to use that lovely green spinning icon that SharePoint uses when its doing something? Try the SPLongOperation class – good example here.
  2. Need to set the audience for a webpart through code? This is what I used!.
  3. Get the current user in InfoPath (not strictly SharePoint, but uses the SharePoint web services). Read this.
  4. Convert the XML that SharePoint returns into a dataset (I find myself using this all the time, probably because I don’t know better!):


public DataSet NSXmlToDataSet(string xmlString)
{
DataSet ds = new DataSet();
XmlDocument xd = new XmlDocument();

xd.LoadXml(xmlString);

XmlNamespaceManager nsMgr = new
XmlNamespaceManager(xd.NameTable);
nsMgr.AddNamespace("rs",
xd.DocumentElement.GetNamespaceOfPrefix("rs"));

XmlNode xn = xd.SelectSingleNode("//rs:data", nsMgr);

XmlNodeReader reader = new XmlNodeReader(xn);
ds.ReadXml(reader);

return ds;
}

Si

Advertisements

InfoPath form security privilege errors

Posted in InfoPath with tags , on February 19, 2008 by Si

Came across the following error message while doing some InfoPath stuff in the office last week:

Insufficient Security privilege. The form cannot be opened because it requests domain security level and is only allowed restricted security level.

What was unusual was that some people got the error, whilst others didn’t, although we all had the same privileges on the server (we checked and double checked that one!). After some fumbling around in the various form options, getting nowhere, we came across the following resolution:

Delete your temporary internet files (include all off-line content as well).

Strange, but true – it worked.

(here’s the MS KB article: http://support.microsoft.com/kb/930892)

Si