• No results found

Integrating InfoPath Forms. Paul Baker

N/A
N/A
Protected

Academic year: 2021

Share "Integrating InfoPath Forms. Paul Baker"

Copied!
104
0
0

Loading.... (view fulltext now)

Full text

(1)

Integrating InfoPath Forms

(2)

About the Speaker….

Paul Baker

Director of Educational Innovation

Perse School, Cambridge

http://www.perse.co.uk

[email protected]

The Perse School regularly features in the top

25 schools nationally. Our commitment to

producing happy and successful students

leads to positive, focused work on how ICT

can contribute to learning and strong

(3)

About the Speaker….

Paul Baker

p_d_baker

mathstweets

(4)

I‟m interested in

SharePoint

Virtual Learning Tools

SCORM Learning Banks

Microsoft Reporting Services

Parent Communication

(5)

A long way to go

….forward together

EASN : East Anglia SharePoint Network for

schools

http://www.easn.org.uk

Sharing ideas and work in progress

Sharing between independent and state

schools

(6)
(7)

Content Slide

an application used to develop XML-based data entry

forms.

To use InfoPath to fill in a form, a user must have a

designer develop an InfoPath template first.

The most common usage of InfoPath is to integrate it

with Microsoft SharePoint.

In SharePoint, a "Form Library" can be created and

developed by using InfoPath. InfoPath fields will be

exported as "Columns" in the library.

(8)

Content Slide

InfoPath 2007

Included in Office 2007 Ultimate and the volume license

editions, Professional Plus, Enterprise, and sold separately

InfoPath 2010

Included in Office 2010 Professional Plus

WSS/SharePoint 2007/2010 to host “form

libraries”

SharePoint Enterprise

for InfoPath form services functionality.

(Or as the separate Office Forms Server 2007 product.)

(9)
(10)

Designed using Controls

Drag and

Drop

(11)

Published

(12)

Designing a form means defining an

xml structure

and

a

user interface

to interact with that structure.

Behind the scenes the structure is defined using

a

schema

InfoPath calls that structure and the data that it

contains when being completed the “

main data

source

(13)
(14)

InfoPath is XML-based

(15)

When a form is completed and saved then that data is

saved as a single xml file, preferably into a sharepoint

forms library that can read the contents of the file

directly.

That xml file contains a reference to the location of

the xsn file so that if it is opened again it can display

the data in the original view.

(16)

In a SharePoint forms library, content of xml

documents can be collated and displayed in

columns in real time.

(17)

Data is well defined

Data can be accessed and transformed or

summarised easily

Validation can be applied

Routing can be applied conditionally

InfoPath is XML-based

(18)
(19)
(20)
(21)
(22)
(23)
(24)
(25)
(26)
(27)
(28)
(29)
(30)
(31)
(32)
(33)
(34)
(35)
(36)
(37)
(38)
(39)
(40)
(41)
(42)
(43)
(44)
(45)

PLACE DEMO TITLE HERE

Designing an InfoPath form.

Adding validation and configuring views.

Publishing options and property promotion.

Save vs Submit

Completing a form

Email options.

(46)

Data Connections can be for

receiving

or

submitting

data.

Connections can be to SQL Server or Access databases,

Web Services, SharePoint List or Library or another

XML document.

Defining a connection creates another “

Data Source

in the InfoPath document.

(47)

InfoPath provides

form templates

to quickly configure

forms whose data structure is determined by an

external data source...

...from a database, a web service or an xml

document.

These templates „lock‟ your main data source schema

to be consistent with the data source you are

connection to.

Limited functionality for writing back to the data

source unless SQL Server or using code.

(48)

PLACE DEMO TITL HERE

Binding a drop down list row items

Using a Data Connection Template

Using The Submit Button

(49)

Public Sub exportXML()

Dim strStaffCode As String, filename As String, strPath As String

strPath = "C:\Users\pdbaker\Documents\SharePoint\LearningGateway2010\DemoDatabase2\" strStaffCode = "MCS"

filename = strStaffCode & ".xml"

Application.exportXML _

ObjectType:=acExportQuery, _ DataSource:="UCASComment", _

DataTarget:=strPath & "raw-" & filename, _

WhereCondition:="StaffCode='" & strStaffCode & "'" Transform _

sourceFile:=strPath & "raw-" & filename, _ stylesheetFile:=strPath & "InfoPath.xsl", _ resultFile:=strPath & filename

End Sub

Private Sub Transform(sourceFile, stylesheetFile, resultFile) ' courtesy of

http://www.oreillynet.com/xml/blog/2005/04/transforming_xml_in_microsoft.html

(50)

<xsl:template match="/"> <xsl:processing-instruction name="mso-infoPathSolution"> <xsl:text> solutionVersion="1.0.0.4" productVersion="12.0.0" PIVersion="1.0.0.0“ href="file:///C:\UCASComments.xsn" name="urn:schemas-microsoft-com:office:infopath:UCASComments:-myXSD-2010-07-09T19-58-45" </xsl:text> </xsl:processing-instruction> <xsl:processing-instruction name="mso-application"> <xsl:text> progid="InfoPath.Document" versionProgid="InfoPath.Document.2" </xsl:text> </xsl:processing-instruction> <xsl:apply-templates select="node()"/> </xsl:template>

Transform Stylesheets

Download an “identity transformation” and then modify the root template to include the InfoPath processing instructions.

(51)

XDocument xml = XDocument.Load(txtFile.Text); XNamespace ns =

"http://schemas.microsoft.com/office/infopath/2003/myXSD/2010-07-10T19:35:48";

var query =

(from p in xml.Elements(ns + "UCASComments").Elements(ns + "UCASComment")

select p.Element(ns + "StaffCode").Value).Distinct();

foreach (var record in query)

{

XDocument xmlOutput = XDocument.Load(txtFile.Text); var queryRemove =

(from p in xmlOutput.Elements(ns + "UCASComments").Elements(ns+"UCASComment")

where p.Element(ns+"StaffCode").Value != record

select p);

queryRemove.Remove();

xmlOutput.Save(txtOutput.Text + @"\" + record + @".xml"); }

(52)
(53)
(54)

Bound to web services

Our MIS

(WCBS PASS)

Code, form, email addresses

of student and teacher which

came from same web

service is separated into

fields.

(55)

[WebMethod]

public XmlDocument getFilteredStudents(string StartsWith) {

DBQuery dbq = new DBQuery();

QueryParamCollection qpColl = new QueryParamCollection(); string param = StartsWith.Trim();

param += param.EndsWith(@"%")?"":@"%"; qpColl.Add(new QueryParam("@StartsWith",param)); XmlDocument result = dbq.executeXMLDocument("zzGetStudentsFilteredXML",dbq.Connection,qpColl); return result; }

(56)

[WebMethod]

public XmlDocument getFilteredStudents(string StartsWith) {

DBQuery dbq = new DBQuery();

QueryParamCollection qpColl = new QueryParamCollection(); string param = StartsWith.Trim();

param += param.EndsWith(@"%")?"":@"%"; qpColl.Add(new QueryParam("@StartsWith",param)); XmlDocument result = dbq.executeXMLDocument("zzGetStudentsFilteredXML",dbq.Connection,qpColl); return result; }

(57)

CREATE PROCEDURE [dbo].[zzGetStudentsFilteredXML] @StartsWith VARCHAR(21) AS ( SELECT 1 as Tag, NULL as Parent, '1' as [outertag!1!id], null as [pupil!2!id], null as [pupil!2!name!element], null as [pupil!2!code!element], null as [pupil!2!form!element], UNION SELECT 2 as Tag, 1 as Parent, '1' as [outertag!1!id], PUPIL_ID AS [pupil!2!id],

SURNAME + ',' + PREFERRED_NAME + ' (' + [FORM] + ')' AS [pupil!2!name!element], CODE AS [pupil!2!code!element],

ISNULL([FORM], "NA") AS [pupil!2!form!element] FROM Curr_Pupils_Curr_Year

WHERE SUB_SCHOOL='UPPER' AND SURNAME LIKE @StartsWith )

ORDER BY [pupil!2!name!element]

(58)

Submit button which

submits first to PASS and

then also to a sharepoint

document library.

Our MIS

(WCBS PASS)

SP creates email

notifications and allows a

secretary to retrieve and

file any documentation

onto the pupil record.

(59)
(60)

[SUBMIT]

WORKFLOW

(SHAREPOINT DESIGNER)

(61)
(62)

Lookup from another SharePoint List

which stores extra staff that want to be notified on the form group level.

(63)
(64)
(65)
(66)
(67)
(68)
(69)
(70)

Case Study 5 : Perse Quiz Project

Images are extracted from the xml when it is submitted to the web service and replaced with the filename of the image. The XML is then just saved, ready to be displayed as a quiz using a stylesheet transform when the quiz is requested.

(71)

InfoPath does code

You can attach code to buttons, form events

and control events

Can be written in C#,VB, Jscript or VBScript

The interface is VSTA : Visual Studio tools for

applications.

You can control the user interface and also

control and requery the data connections using

the object model.

(72)

InfoPath does code

Example: Copy nodes directly from a data

connection to your own main data source.

(73)

InfoPath does code

public void btnLoad_Clicked(object sender, ClickedEventArgs e) {

// Create an XPathNavigator object to navigate the main data source XPathNavigator xpnMain = MainDataSource.CreateNavigator();

string strFilter = xpnMain.SelectSingleNode("/my:UCASComments/my:txtFilter", NamespaceManager).Value;

// Retrieve the connection object from the data connection

AdoQueryConnection myConn = (AdoQueryConnection)(DataSources["qryUCAS"].QueryConnection); myConn.Command =

@"select [StaffCode],[Department],[Pupil Name] as [PupilName],[Yeargroup] from [qryUCAS] as [qryUCAS]

where [StaffCode] like '" + strFilter + "%'"; myConn.Execute();

// Delete current ucas comments from the main data source XPathNavigator xpnOld;

do {

xpnOld = xpnMain.SelectSingleNode("/my:UCASComments/my:UCASComment", NamespaceManager); if(xpnOld!=null)

xpnOld.DeleteSelf(); } while (xpnOld!=null);

(74)

InfoPath does code

// Create an XPathNavigator object to navigate the data connection XPathNavigator xpnDConn = DataSources["qryUCAS"].CreateNavigator();

XPathNodeIterator xpnNewNodes = xpnDConn.Select("/dfs:myFields/dfs:dataFields/d:qryUCAS", NamespaceManager); XPathNavigator xpnUCASComments = xpnMain.SelectSingleNode("/my:UCASComments", NamespaceManager);

string nspace = xpnUCASComments.NamespaceURI; foreach(XPathNavigator xpnNew in xpnNewNodes) {

XmlWriter writer = xpnUCASComments.PrependChild(); writer.WriteStartElement("my", "UCASComment", nspace);

writer.WriteElementString("my", "StaffCode",nspace, xpnNew.SelectSingleNode("@StaffCode").Value); writer.WriteElementString("my", "Department", nspace, xpnNew.SelectSingleNode("@Department").Value); writer.WriteElementString("my", "PupilName", nspace, xpnNew.SelectSingleNode("@PupilName").Value); writer.WriteElementString("my", "Yeargroup", nspace, xpnNew.SelectSingleNode("@Yeargroup").Value); writer.WriteElementString("my", "Comment", nspace, "");

writer.WriteEndElement(); writer.Close();

} }

(75)

Tool Tie-ins

(76)

Tool Tie-ins

(77)

Tool Tie-ins

(78)

Tool Tie-ins

(79)

Tool Tie-ins

Parent Communication :

www.schoolpost.co.uk

?

(80)

Tool Tie-ins

Workflow Tools

Visual Studio

SharePoint Designer

Visio

Nintex

(81)

Tool Tie-ins

(82)

Tool Tie-ins

(83)
(84)

Digital signatures

Can enable digital signatures on sections of the form

And when applied can make the form „read only‟

But requires a certification authority or Windows Server acting in

this role or self-certified (but the latter is not secure and requires

access to the certificates snap-in of mmc to update/delete.)

(85)

Digital signatures

Perhaps Workflows and “Contact Selector” controls are better

When submitted then if it is missing an HOD signature then the

workflow generates an email to the HOD with the link to the

submitted form.

When both boxes are ticked then the workflow generates an

„acknowledgement‟ email to both parties and rules can make the

form read only.

(86)

InfoPath Form Services

Hosts the InfoPath form in the browser...

...so clients don‟t need the application installed.

Limits the functionality that you can use. Needs to be more „standard‟ and

doesn‟t support certain controls (e.g. attachment or image control or

bulleted list) and restrictions on code, rules, filters etc.

http://office.microsoft.com/en-us/infopath-help/infopath-2007-features-

that-are-unavailable-in-infopath-forms-services-HA010210587.aspx?CTT=3#BM4

Requires SharePoint Enterprise

With more detailed forms it is probably still better to be designing on a

client application that can be saved at regular intervals to your hard drive

and doesn‟t „rely‟

Free, widely distributed client app would be perfect

Are Microsoft heading in that direction?

(87)

Contact Selector

http://www.sharepointassist.com/2009/02/27/adding-a-contact-selectorpeople-picker-to-an-infopath-form/

(88)
(89)
(90)

Template Parts

(91)
(92)
(93)

InfoPath 2010

(94)

InfoPath 2010

Conforms with the Ribbon interface

More pre-built and attractive layouts

(95)

InfoPath 2010

New and Improved Controls

New controls in InfoPath 2010 include:

Picture buttons – Instead of the default gray button, use any image as a button in your

form.

Hyperlink capabilities –Allow users to insert their own hyperlinks when filling out

forms.

Date and time picker – Allow users to insert dates and times in their forms

Person/Group pickers – Updated! This is now a first class control and is included by

default in the Controls gallery.

Signature Line (Editor Only) – Allow users to digitally sign a form

Controls and functionality that are now supported in browser forms include:

Bulleted, numbered, and plain lists, multiple selection list boxes, Combo boxes, Choice

group and sections, and Filtering functionality.

(96)

InfoPath 2010

New and Improved Add Rules to your Forms

With our new out-of-the-box rules (or quick rules) and improved

rules management UI, you can easily add rules to validate data,

format your form, or perform other actions with just a couple of

clicks, and without any code.

(97)

InfoPath 2010

Publish Forms Quickly

Our new “quick” publish functionality allows you to publish forms in

a single click (no more clicking through the Publishing Wizard every

time you want to make an update to your forms!)

Create Mashups using the InfoPath Form Web Part

Now, without writing a single line of code, you can host your InfoPath

browser forms in Web pages by simply adding the InfoPath Form

Web Part to a Web Part page. You can also connect it to other Web

Parts on the page to send or receive data.

(98)

InfoPath 2010

Create Forms for SharePoint Lists

Using InfoPath, you can now extend and enhance the forms used for creating,

editing and viewing items in a SharePoint list. In a browser, simply navigate to a

SharePoint list, and on the SharePoint Ribbon under List Tools, choose the

Customize Form option. This will automatically generate a form which looks very

similar to the default out-of-the-box SharePoint list form.

You can then customize and enhance this form by

modifying the layout, creating additional views or

pages, and adding rules to validate your data,

show or hide sections of the form or set a fields

value (to name just a few of the options).

(99)

InfoPath 2010

Create SharePoint Applications

With InfoPath 2010, SharePoint Server 2010, and SharePoint

Designer 2010, you can easily create powerful team, departmental

or enterprise applications on top of SharePoint Server.

Form-based applications: InfoPath forms can be integrated with

components such as workflow, reporting, and custom Web pages to

create rich form-based applications.

Document Workflows: InfoPath can be used to design custom workflow

initiation and task forms that drive document management processes.

Business Connectivity Services: Integrating with BCS, it is

straightforward to design InfoPath forms that create, read, update,

and delete business data from a back-end system.

(100)

InfoPath 2010

InfoPath Editor

The InfoPath 2010 Editor Fluent user interface provides a much

improved, simpler user experience for filling out forms.

(101)

Lessons learnt

Allow/encourage users to save straight away

Allow save with validation errors – use the

„complete‟ technique instead.

Remind users that they can save into “my

documents” if they have connectivity problems

Infopath documents are much more stable than web

forms (which expire/lose connections)

…but do require InfoPath to be installed on the

client.

(102)

Lessons learnt

InfoPath form services don‟t support all the

functionality of InfoPath.

Be careful when changing the design of a „live‟ form to

maintain data compatibility with completed forms

where necessary.

You can set up alerts on sharepoint (or workflows

through sharepoint designer) that react to what has

been entered in the form

Make sure you keep the xsn file where it was published

(i.e. don‟t delete the forms library or the folder in the

case of a network share). Otherwise completed forms

can‟t be easily opened.

(103)
(104)

Thank you for attending!

[email protected]

http://www.perse.co.uk

References

Related documents

Write in either the infinitive or gerund form, students complete a range of exercises to learn and practice commonly used gerunds and infinitives.. Modal verbs do not change in form

In this section students explore form creation in InfoPath by creating List based forms as well as Library based forms.. Students learn about InfoPath page design templates, how

A profile of current housing supply in Baker City was estimated based on permit data from the City of Baker City and Census data from the most recently available 2018 ACS,

English learners have connect with gerunds and infinitives A gerund is the ing form of open verb that functions the draw as compound noun an example.. Gerund vs Infinitive Practice

If the condition is not stable, information on interventions (including the individual’s own strategies) for exacerbations and recommended timelines for re- evaluation are

Why have three to revocable living trust amendment form california, some commercial annuities will provide nefits after the death of the owner.. All shares or ownership interests

2) be within a census tract with a Rural Urban Commuting Area (RUCA) code of 4 or higher, which is the USDA classification.. 65% of the churches in the Tennessee and Memphis

When you give Lloyd's and its agents personal information about other individuals, we rely on you to have made or make them aware that you will or may provide their