Sign in
MSDN Blogs
Microsoft Blog Images
More ...
Microsoft InfoPath 2010
The official blog of the Microsoft InfoPath team
Common Tasks
Blog Home
Subscribe via RSS
RSS for comments
RSS for posts
Atom
recent posts
Protecting Sensitive Data
Posted
over 7 years ago
by
infopath1
Dynamic Pictures
Posted
over 7 years ago
by
infopath1
Save the Date! Using Horizontal Repeating Sections
Posted
over 7 years ago
by
infopath1
Tags
5 for forms
Academy Live
Beta
Browser Forms
Community
Controls
Cool Forms
Data Connections
Developer
Formulas and XPath
InfoPath 2010
InfoPath Form Web Part
Layout
Outlook
Picture button
Rapid Development
Sandboxed Solutions
SharePoint
SharePoint List
SharePoint Lists
Talks
Technical Preview
VSTA
Web Part
Writing Code
General
Office Online
Support Center
Office Developer Center
InfoPath Dev
Office Blogs
Microsoft Access
Microsoft Excel
Microsoft OneNote
Microsoft Outlook
Microsoft PowerPoint
Microsoft Project
Microsoft Publisher
Microsoft SharePoint
Microsoft SharePoint Designer
Microsoft SharePoint Workspace
Microsoft Visio
Microsoft Word
Office 2010 Engineering
Office Extensibility
Office Global Experience
Office Interoperability
Office Math
Office Natural Language Team
Office Sustained Engineering
Office Web Applications
Performance Point
Archives
Archives
April 2011
(1)
July 2010
(3)
June 2010
(3)
May 2010
(7)
April 2010
(12)
March 2010
(8)
February 2010
(8)
January 2010
(8)
December 2009
(3)
November 2009
(2)
October 2009
(3)
August 2009
(3)
July 2009
(3)
February 2009
(1)
October 2008
(1)
September 2008
(2)
August 2008
(1)
July 2008
(1)
June 2008
(5)
May 2008
(1)
April 2008
(1)
July 2007
(1)
May 2007
(2)
April 2007
(1)
March 2007
(11)
February 2007
(14)
January 2007
(13)
December 2006
(10)
November 2006
(14)
October 2006
(13)
September 2006
(3)
August 2006
(2)
July 2006
(8)
June 2006
(11)
May 2006
(8)
April 2006
(7)
March 2006
(2)
February 2006
(1)
December 2005
(1)
November 2005
(1)
August 2005
(1)
July 2005
(1)
June 2005
(3)
April 2005
(3)
March 2005
(2)
February 2005
(4)
January 2005
(2)
December 2004
(4)
November 2004
(8)
October 2004
(8)
September 2004
(10)
August 2004
(7)
July 2004
(2)
June 2004
(5)
May 2004
(12)
April 2004
(12)
March 2004
(16)
September, 2006
MSDN Blogs
>
Microsoft InfoPath 2010
>
September, 2006
Subscribe via RSS
Sort by:
Most Recent
|
Most Views
|
Most Comments
Excerpt View
|
Full Post View
Microsoft InfoPath 2010
Protecting Sensitive Data
Posted
over 7 years ago
by
infopath1
9
Comments
Frequently, we find developers using InfoPath as a platform for developing solutions that manipulate sensitive data, may it be financial data, patient records, or performance review forms. This article shares tips on protecting such data.
First and foremost, you must know that an
InfoPath form is a plain-text XML file
. A malicious user can read it through Notepad or other text editor, circumventing any InfoPath authentication logic. So if a user has read access to an InfoPath XML form, anything stored in that XML file can be read. Information Rights Management in InfoPath 2007 allows storing encrypted XML; we'll talk more about it below.
Also remember that an InfoPath form template (.xsn file) is just a CAB archive, containing plain-text files. These files store all client-side form logic. Information Rights Management allows you to encrypt form templates in InfoPath 2007, see more about it below.
Like with any other client-server application development platform, you can
never trust the logic that happens on the client
. InfoPath uses the form template to store all form logic; if the user has access to the form template (and they must in order to be able to open any form based on that form template), they can create a hacked version of the template, circumventing any restrictions that the original form author put in place.
This means that authentication and authorization performed on the client can't be trusted; calculations and data validation have to be re-done on the server. Here is an example of how this strategy can be realized for a simple record-keeping application:
Do not store sensitive data in the XML file; instead, store keys in the XML file, and perform queries on load that populate the rest of the data by using a database/web service. If the user is unauthorized (as determined by the server-side logic), return an empty dataset. You can even detect such condition on the client and show a friendly error message.
On submit, send the data to a web service and redo all non-schema validations on the server side. For example, if employees should not be able to submit expense reports above $100 without specifying an approver, have your web service process the dataset and verify that this condition is satisfied.
It is always a good idea to
restrict access to a production
form template
by assigning read-only permissions to form users, write access to form maintenance staff, and no access to everyone else. This can be done by using permission features of the SharePoint Server or file shares. Even if you install form templates to the users' machines via a logon script, you can still control access to the .xsn file - provided the user is not running as an administrator, you can set their access to the template file to read-only.
You may want to
enable the protection feature for production form templates
:
However, remember that this protection feature is
for recommendations only
, it is not intended as a security mechanism. This will show the user a nice error message if they
accidentally
try to open the template in the Design mode, but won't defend the form template against a malicious user.
Information Rights Management, or IRM, is a new feature for InfoPath 2007; some of you may already be familiar with the concepts from the other apps in the Office 2003 release.
IRM allows the form author to protect both the form template and forms based on the template
; IRM infrastructure must be in place in the organization to make this possible. Briefly, IRM is a way to encrypt both form templates and forms, allowing form author to specify who can access the template and suggest default rights for forms based on the template:
Note that IRM is an InfoPath client-only feature, and it will not work in browser-enabled form templates.
Alex Weinstein
Program Manager
Microsoft InfoPath 2010
Dynamic Pictures
Posted
over 7 years ago
by
infopath1
6
Comments
When designing a feature-rich InfoPath form template, it is sometimes necessary to provide a dynamic image in response to user action. InfoPath picture control hides treasures that will help you satisfy such a requirement. In this article, we will explore a technique that allows you to make this happen without writing any code.
Here is our scenario: build a hardware order form for the telecommunications department. In the form, we would like to let the user choose the phone that they want to order, and show them a picture of the phone as soon as they select it.
The following steps will make this possible:
Place pictures of available phones in a shared location; let's call it
http://mysite/phones/photos/
. Pictures are named according to phone ID's - for example, 1.jpg, 2.jpg, 3.jpg, etc.
Insert a picture control. When you do so, InfoPath will ask whether you want the picture to be included into the form, or if you want it to be linked. Choose the second option.
Take a look at the node that was just inserted into your data source by going to View | Data Source. Let’s call the new node
hyperlinkDataSource;
it’s a node with data type "hyperlink".
Insert a text box that’s also bound to
hyperlinkDataSource
.
Preview the form. Use the picture control to attach the image. Observe how the path in the text box changes to reflect the path of the image you just attached. Try changing the value of the text box to point to a different picture. Note how the picture control displays the new picture when you tab out of the text box.
Now, we want this step to happen programmatically, when the user selects the phone from the dropdown of available phones.
Create a phone picker dropdown; labels in the dropdown will show phone names, and values will contain phone ID's that correspond to file names we used in step 1. The simplest way to do this is to enter the items manually; don't forget to include the default "pick a phone" item.
If you want to get fancy, you can use a secondary data source - web service - to provide the list of available phones.
Create a rule on the
phonePicker
node: set the value of
hyperlinkDataSource
to
concat("
http://mysites/phones/photos/
", phonePicker, ".jpg")
Go to control properties for the new picture control; uncheck the “Allow users to browse for new pictures” property.
We're done! Preview the form and try selecting a few phones from the dropdown.
Picture control is available in both InfoPath 2003 and 2007, however it is not supported in browser-enabled form templates.
Alex Weinstein
Program Manager
Microsoft InfoPath 2010
Save the Date! Using Horizontal Repeating Sections
Posted
over 7 years ago
by
infopath1
4
Comments
InfoPath 2007 introduces a new flavor of the repeating section control - horizontal repeating section. It is useful when you want to present or edit repeating data in a structured format. When new items are added, they show up side-by-side with the existing items instead of one on top of the other.
Horizontal repeating section is a new building block for layouts. In my
previous post
about horizontal repeating tables, we discussed how a horizontal repeating table is a combination of a horizontal repeating section and layout tables. You can make your own new layouts by using this new control.
For example, one cool use of a horizontal repeating section is a "calendar" - style form:
Play with it!
Download the form template
and try a few things (requires InfoPath 2007, and save it to your computer before opening it):
Switch to a different month by using a dropdown on top of the form.
Add a note for a day.
Add a note with an exclamation sign (i.e. "presentation!") - notice the day turning red.
Switch views to the summary view, and observe all appointments as a flat list.
Open the form template in design view, and view its logic by going to Tools | Logic Inspector.
How it's done
In this form, each day in the calendar is displayed by using a horizontal repeating section; only the header ("Monday, Tuesday, Wednesday…") is static. To accomplish this, we are using several powerful tricks:
Calendar generation is completely dynamic. To generate a view of a different month, we are setting the following fields in the form under
myFields/currentMonth
:
firstDay
[date field in XML format (YYYY-MM-DD); set to the first day of the month that you want to view the calendar for - i.e. for May 2007, set to "2007-05-01"]
numberOfDays
[integer; number of days in the month that you want to present; i.e. for May 2007, set to "31"]
mondayOffset
[integer; weekday of first day of the month; Sunday=0, Monday = 1, Tuesday = 2, etc. I.e. for May 2007 that starts on Tuesday, set to "2"]
Note that if you wanted to extend this calendar to show additional months, you could do so by adding rules to set these parameters for different months. It's also easy to move this logic to a web service or form code - thus eliminating the need to maintain a static list of months.
Horizontal Repeating Sections wrap when placed inside a table. The wrapping point is determined by table width. This allows us to set up a 7-day-long week.
Conditional formatting works just as expected on horizontal repeating sections. This allows us to highlight today's date, set red background for days marked with an exclamation sign, and set correct background color for weekends.
Default values help us create a necessary number of instances of the horizontal repeating section to cover for the longest month, even if it starts on Saturday. We need 6 instances to cover for "blank" days before the first day of the month, plus a maximum of 31 days in a month = 37 instances. To accomplish this, you can follow the technique from
this article
.
Rules provide a mechanism for month selection: when a month is selected from the dropdown on top of the form, correct values are set for nodes under
myFields/currentMonth
.
Of course, there are many uses beyond a calendar, otherwise we would have just built a calendar control, but we couldn't resist sharing this example because it shows off so many tricks.
Alex Weinstein
Program Manager
Page 1 of 1 (3 items)