Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

24
SharePoint dnevi 2011 Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2 Toni Frankola SharePoint MVP Croatia @tonifrankola http://sharepointuseca ses.com

description

Developing InfoPath forms with OOTB tools is easy and can often solve many business requirements, but there are requirements that cannot be solved with just OOTB tools. In this session you will learn how to programmatically integrate InfoPath with SharePoint workflow engine, extract workflow history, customize the forms on fly, use the Word Service to convert form to other formats and much more.

Transcript of Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Page 1: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

SharePoint dnevi 2011

Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Toni FrankolaSharePoint MVP

Croatia@tonifrankola

http://sharepointusecases.com

Page 2: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Bled, 24. in 25. oktober 2011SharePoint dnevi 2011

Documentation Toolkit for SharePoint

• Document• Track Changes• Compare Farms

Page 3: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Bled, 24. in 25. oktober 2011SharePoint dnevi 2011

Contents

• Event handlers stuff– Add signatures– Convert to PDF

• +Wizards• +Security• +Permissions via SharePoint• User profile service• Repeating table filtering

Page 4: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Bled, 24. in 25. oktober 2011SharePoint dnevi 2011

InfoPath Fields (2)

Page 5: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Bled, 24. in 25. oktober 2011SharePoint dnevi 2011

InfoPath Fields (2)

Page 6: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Bled, 24. in 25. oktober 2011SharePoint dnevi 2011

Views

• Different layouts on top of form dana• Used for:– Read-only views– Print views– Wizards– Security (roles)

Page 7: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Bled, 24. in 25. oktober 2011SharePoint dnevi 2011

Roles

• Scenario:– Annual leave approval– Demo

• Control access to views and fields• Pros– OOTB, config via UI

• Cons– Not available in browser forms– Not real security

Page 8: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Bled, 24. in 25. oktober 2011SharePoint dnevi 2011

ROLESDemo

Page 9: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Bled, 24. in 25. oktober 2011SharePoint dnevi 2011

„Wizard”

• Implemented as series of views• Navigation handled with buttons– Or custom logic

Page 10: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Bled, 24. in 25. oktober 2011SharePoint dnevi 2011

WIZARDDemo

Page 11: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Bled, 24. in 25. oktober 2011SharePoint dnevi 2011

Security

• No OOTB InfoPath forms security– Entire form is a SharePoint item– Configure permissions via SPD WF or event

receiver.– BUT read this before:• SharePoint Server 2010 capacity management: Softwar

e boundaries and limits• The maximum number of unique security scopes set for

a list should not exceed 1,000.

Page 12: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Bled, 24. in 25. oktober 2011SharePoint dnevi 2011

SECURITY WORKFLOWDemo

Page 13: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Event Receivers• Item Events

– ContextEvent– ItemAdding/ItemAdded– ItemUpdating/ItemUpdated– ItemDeleting/ItemDeleted– ItemCheckingIn/ItemCheckedIn– ItemCheckingOut/ItemCheckedOut– ItemUncheckingOut/ItemUncheckedOut– ItemAttachmentAdding/ItemAttachmentAdded– ItemAttachmentDeleting/ItemAttachmentDeleted– ItemFileMoving/ItemFileMoved– ItemFileConverted

• Workflow Events– WorkflowStarting/WorkflowStarted– WorkflowPostponed– WorkflowCompleted

Site EventsSiteDeleting/SiteDeletedWebDeleting/WebDeletedWebMoving/WebMoved

WebAdding/WebProvisioned

List EventsEmailReceivedFieldAdding/FieldAddedFieldUpdating/FieldUpdatedFieldDeleting/FieldDeleted

ListAdding/ListAddedListDeleting/ListDeleted

Page 14: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Bled, 24. in 25. oktober 2011SharePoint dnevi 2011

Convert forms to PDF

• XML• XSL• Images

InfoPath

• XML to• HTML

(via XSL)

Event Handler• HTML to PDF

Word Services

Page 15: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Bled, 24. in 25. oktober 2011SharePoint dnevi 2011

INFOPATH TO PDFDemo

Page 16: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Bled, 24. in 25. oktober 2011SharePoint dnevi 2011

Working with User Profile Service

• Important user info– Departments, Managers, Managers of Managers

etc.• Connects to user profile service

– http://ServerName/_vti_bin/UserProfileService.asmx

Page 17: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Bled, 24. in 25. oktober 2011SharePoint dnevi 2011

Properties• UserProfile_GUID

AccountNameFirstNameLastNamePreferredNameWorkPhoneOfficeDepartmentTitleManagerAboutMePersonalSpacePictureURLUserNameQuickLinksWebSitePublicSiteRedirectSPS-Dotted-line

• SPS-PeersSPS-ResponsibilitySPS-SkillsSPS-PastProjectsSPS-InterestsSPS-SchoolSPS-SipAddressSPS-BirthdaySPS-MySiteUpgradeSPS-DontSuggestListSPS-ProxyAddressesSPS-HireDateSPS-LastColleagueAddedSPS-OWAUrlSPS-ResourceAccountNameSPS-MasterAccountNameAssistantWorkEmailCellPhoneFaxHomePhone

Page 18: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Bled, 24. in 25. oktober 2011SharePoint dnevi 2011

WORKING WITH USER PROFILE SERVICE

DEMO

Page 19: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Bled, 24. in 25. oktober 2011SharePoint dnevi 2011

Reporing for InfoPath forms

• Simple list reporting– SharePoint UI– Export to Excel

• Reporting Services (SQL 2008 R2)– What’s new

• Parsing values (repeating tables)– Storing to database• Custom code• 3rd party

Page 20: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Bled, 24. in 25. oktober 2011SharePoint dnevi 2011

INFOPATH REPORTINGDemo

Page 21: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Bled, 24. in 25. oktober 2011SharePoint dnevi 2011

Helpers

• InfoPath Cascading drop-down• Beyond lookup column

Page 22: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Bled, 24. in 25. oktober 2011SharePoint dnevi 2011

EXTERNAL FORMSCASCADE LOOKUPS

Page 23: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

Bled, 24. in 25. oktober 2011SharePoint dnevi 2011

Conclusion

• Extend OOTB Forms with some additional code

• Use Event Receivers

Page 24: Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2

SharePoint dnevi 2011

Questions?Documentation Toolkit for

SharePoint >

Document • Track Changes • Compare Farms