Your SlideShare is downloading. ×

Working With InfoPath Controls

14,145

Published on

A list of 38 InfoPath articles and tutorials explaining how to work with and get things done with InfoPath controls, including text boxes, list boxes, drop-down list boxes, combo boxes, buttons, rich …

A list of 38 InfoPath articles and tutorials explaining how to work with and get things done with InfoPath controls, including text boxes, list boxes, drop-down list boxes, combo boxes, buttons, rich text boxes, and date picker controls.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
14,145
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
228
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Working with Controls in InfoPath Table of Contents Buttons ............................................................................................................ 3 How to create a toggle button in InfoPath using rules and conditions.................................. 3 How to programmatically disable/enable a control on an InfoPath form ............................... 3 Text Boxes........................................................................................................ 3 Auto-formatting a time field in InfoPath when it loses the focus......................................... 3 Programmatically retrieve the value of an InfoPath form field using .NET code ...................... 3 Rich Text boxes ................................................................................................. 3 Displaying images in InfoPath 2007 browser forms served through Forms Services in SharePoint ................................................................................................................... 3 How to display images in a repeating table in an InfoPath browser form using a Rich Text Box control ........................................................................................................... 3 Programmatically add an item with a Rich Text field to a SharePoint list using InfoPath 2007..... 3 How to get HTML tags to appear as HTML and not as plain text in a Rich Text Box ................ 3 How to programmatically get or set the XHTML code of a Rich Text field in InfoPath 2007 ........ 3 Programmatically convert Rich Text data from InfoPath to Word DOCX .............................. 3 Programmatically add lines of text to a Rich Text Box field on an InfoPath form using C# code... 4 Drop-down list boxes .......................................................................................... 4 Auto-fill fields in InfoPath from a drop-down list box selection and secondary data source ......... 4 Create a shrinking list in a repeating table in InfoPath ................................................... 4 Database record selection in InfoPath through a dropdown list box.................................... 4 Dynamically fill a drop-down list box in a browser form using another InfoPath form as a data source ........................................................................................................... 4 Filtered cascading drop-downs in InfoPath browser forms using SharePoint lists and WSS owssvr.dll ....................................................................................................... 4 How to simulate Excel's VLOOKUP function in InfoPath to look up data in a secondary data source using rules and filters ................................................................................. 4 Programmatically check whether a value exists in a drop-down list box bound to a SharePoint list using an XPath filter ........................................................................................... 4 Programmatically add items to a drop-down list box in InfoPath 2007 ................................. 4 Combo boxes .................................................................................................... 4 Automatically type in and add a new item to a drop-down list box on an InfoPath form ............. 4 Display a message box if an item does not exist in the list of entries for a combo box .............. 5 List boxes......................................................................................................... 5 InfoPath Basics: List control basics in InfoPath ........................................................... 5 Programmatically move items between two lists in InfoPath using C# code .......................... 5 Understanding the Multiple-Selection List Box in InfoPath .............................................. 5 Programmatically select all items in a multiple-selection (multi-select) list box ....................... 5
  • 2. Date Pickers ...................................................................................................... 5 Auto-populate a repeating table in InfoPath with sequential dates ..................................... 5 Calculate the difference between two date picker controls in InfoPath using rules and formulas - no code! ......................................................................................................... 5 Calculating a person's age given a date of birth using rules and formulas in InfoPath .............. 5 Calculating date differences in InfoPath using SharePoint Excel Services............................ 5 Calculating time differences in InfoPath without custom code .......................................... 5 Create a day of the week InfoPath form using rules and formulas ..................................... 6 Filter a SharePoint list in a repeating table in InfoPath on a date range ............................... 6 Filtering a list in InfoPath on the current month and day period ......................................... 6 Forcing users to select a particular day of the week from a date picker in InfoPath using rules and formulas ......................................................................................................... 6 How to check whether a start date falls before an end date in InfoPath ............................... 6 How to extract the month name from a date picker in InfoPath ......................................... 6 Selecting the minimum date in an InfoPath repeating table using formulas (no code) .............. 6 Calculating date differences in InfoPath 2007 browser forms using C# code ......................... 6
  • 3. Buttons How to create a toggle button in InfoPath using rules and conditions This article shows how you can create a toggle button in InfoPath using only rules and conditions; no code. How to programmatically disable/enable a control on an InfoPath form Use code to programmatically set the value of a control that will trigger Conditional Formatting on the control that you want to disable/enable. Text Boxes Auto-formatting a time field in InfoPath when it loses the focus Use rules, conditions, the concat() function, and the substring() function in InfoPath to convert the way a time field is displayed from hhmm to hh:mm when the field loses the focus. Programmatically retrieve the value of an InfoPath form field using .NET code Use the Copy XPath functionality to find out what the XPath expression of the field is and the Value property of the XPathNavigator object to retrieve the value of the field. Rich Text boxes Displaying images in InfoPath 2007 browser forms served through Forms Services in SharePoint Learn about workarounds that are available to display images in InfoPath forms that are served via InfoPath Forms Services in SharePoint. How to display images in a repeating table in an InfoPath browser form using a Rich Text Box control While the Picture control is not available in InfoPath browser forms, you can write code to programmatically add a link to an image to a Rich Text Box control to display images in browser forms. Programmatically add an item with a Rich Text field to a SharePoint list using InfoPath 2007 Programmatically add an item to a SharePoint list by submitting a CAML update batch to the UpdateListItems method of the Lists web service that comes with Windows SharePoint Services (WSS). How to get HTML tags to appear as HTML and not as plain text in a Rich Text Box Learn how to write code to render HTML in a Rich Text Box. How to programmatically get or set the XHTML code of a Rich Text field in InfoPath 2007 Learn how to use the InnerXml property of an XML node to get and set the XHTML code of a Rich Text field on an InfoPath form template. Programmatically convert Rich Text data from InfoPath to Word DOCX Learn how to use the WindowsBase DLL and the System.IO.Packaging namespace to export the contents of a Rich Text Box field on an InfoPath form to a Word 2007 document.
  • 4. Programmatically add lines of text to a Rich Text Box field on an InfoPath form using C# code Use C# code to add DIV elements to apply line-breaks between lines of text in a rich text box field on an InfoPath form. Drop-down list boxes Auto-fill fields in InfoPath from a drop-down list box selection and secondary data source Use rules and filters on the secondary data source to retrieve information from the secondary data source and fill fields on the form with data related to the selected item in the drop-down list box. Create a shrinking list in a repeating table in InfoPath Learn how to use rules and conditions in InfoPath to create a drop-down list box that shrinks in items as rows are inserted into the repeating table that contains the drop- down list box. Database record selection in InfoPath through a dropdown list box Learn how to select an item from a dropdown list box, retrieve the database record corresponding to the item, and display the data in fields in InfoPath 2003. Dynamically fill a drop-down list box in a browser form using another InfoPath form as a data source Use the FileLocation property of the FileQueryConnection object to switch and point to different XML files when filling a drop-down list box. Filtered cascading drop-downs in InfoPath browser forms using SharePoint lists and WSS owssvr.dll Learn how you can use Windows SharePoint Services' (WSS) owssvr.dll and InfoPath's FileQueryConnection to write code that filters SharePoint list data displayed in dependent or cascading drop-down list boxes on an InfoPath browser form in SharePoint. How to simulate Excel's VLOOKUP function in InfoPath to look up data in a secondary data source using rules and filters Learn how to use rules and filters to look up data in a secondary data source (here: a SharePoint list) when an item is selected from a drop-down list box and create functionality similar to Excel's VLOOKUP function, but then in InfoPath. Programmatically check whether a value exists in a drop-down list box bound to a SharePoint list using an XPath filter Learn how to use an XPath filter expression on a SharePoint list to look up a value in a secondary data source to which a drop-down list box in InfoPath is bound. Programmatically add items to a drop-down list box in InfoPath 2007 Bind the drop-down list box to a repeating node in either the Main or a secondary data source, and then loop through rows of data in another data source to populate the data source that is bound to the drop-down list box. Combo boxes Automatically type in and add a new item to a drop-down list box on an InfoPath form
  • 5. Use a combo box control and a web service to automatically type in and add new items to a list, thereby updating the underlying data store of the secondary data source that the combo box is bound to. Display a message box if an item does not exist in the list of entries for a combo box Use a rule to display a message box when an item entered into a combo box cannot be found in a list of valid entries. List boxes InfoPath Basics: List control basics in InfoPath This article explains how to use list controls such as drop-down list boxes, combo boxes, list boxes, and multi-select list boxes in InfoPath. Programmatically move items between two lists in InfoPath using C# code Learn how to copy items from a secondary data source to a list in the Main data source of a form and then move items between two lists which are bound to two repeating groups in the Main data source of the form template. Understanding the Multiple-Selection List Box in InfoPath Learn how multiple-selection list boxes differ from other list boxes in InfoPath, how they store data, and how you can use this information to apply rules and conditional formatting, or to write code in InfoPath. Programmatically select all items in a multiple-selection (multi-select) list box Use C# or Visual Basic code to loop through all of the items in the secondary data source a multi-select list box is bound to, and add each item to the DOM node that represents the multi-select list box. Date Pickers Auto-populate a repeating table in InfoPath with sequential dates Learn how you can use a function and formulas in InfoPath 2007 to populate rows in a repeating table with sequential dates by entering one date and having the rest of dates automatically calculated and displayed. Calculate the difference between two date picker controls in InfoPath using rules and formulas - no code! Use rules, conditions, and the number(), floor(), and substring() functions in formulas to calculate the difference between two date picker controls in InfoPath. Calculating a person's age given a date of birth using rules and formulas in InfoPath Use rules, conditions, the today() function, the number() function, and the substring() function in InfoPath to calculate a person's age from his/her date of birth. Calculating date differences in InfoPath using SharePoint Excel Services Use an Excel workbook published to Excel Services on a Microsoft Office SharePoint Server 2007 to calculate the difference between two dates in InfoPath without writing a single line of code. Calculating time differences in InfoPath without custom code Use rules in InfoPath to calculate the difference between start and end times, and sum the time differences to get a grand total amount of hours.
  • 6. Create a day of the week InfoPath form using rules and formulas Use a formula to calculate the number for the day of the week (Monday through Sunday) based on a date specified in a Date Picker control, and conditional formatting on sections to show/hide the weekday sections on an InfoPath form. Filter a SharePoint list in a repeating table in InfoPath on a date range Use conditional formatting on a repeating table in InfoPath to filter a SharePoint list on a date range using two date picker controls. Filtering a list in InfoPath on the current month and day period Use rules and filter conditions in InfoPath to filter a list containing dates first on the current month and then on a specific period between a minimum and maximum day number. Forcing users to select a particular day of the week from a date picker in InfoPath using rules and formulas Use data validation, rules, and the number(), floor(), and substring() functions to derive and check the day of the week when a date is selected from a date picker control in InfoPath. How to check whether a start date falls before an end date in InfoPath This article shows you how to use data validation rules in InfoPath to compare two dates and check whether one date falls before another. How to extract the month name from a date picker in InfoPath Learn how to use a secondary data source, rules, filters, and InfoPath functions to extract the month name from the secondary data source based on the date that is displayed in a date picker control. Selecting the minimum date in an InfoPath repeating table using formulas (no code) Learn how you can use a formula (no code) in InfoPath to find and highlight the rows in a repeating table that contain the date that falls before all other dates in one of the repeating table's columns. Calculating date differences in InfoPath 2007 browser forms using C# code Write C# code which uses the Site property of the XMLEventArgs object and the TimeSpan object in the Changed event of the date fields to calculate the difference between the dates in each row of a repeating table.

×