Use Form View when configuring session state for InfoPath Forms Services
By peter.stilgoe
You can configure InfoPath Forms Services to use the Session State Service (the default option) or Form View to control how user sessions are managed. When you configure InfoPath Forms Services to use the Session State Service, all browser sessions are maintained on the SQL Server database corresponding with the Shared Services Provider (SSP) associated with the Web application on which the form template is hosted. This scenario uses little network bandwidth, but has a cumulative performance impact on the computer running SQL Server. When you are using Form View, sessions are maintained on the client browser, and all session data is included in each postback to the server, up to 40 kilobytes of session data. This uses more bandwidth than using session state, but does not affect the computer running SQL Server. Once session data reaches 40 KB in size, the session automatically transitions to session-state management.
We recommend the use of Form View in environments that have smaller groups of users, because it reduces the impact on SQL Server. If your InfoPath Forms Services deployment will have many users, particularly if session data is below 40 KB for many high-usage form templates, session state is likely a better choice. If Form View is used, the bandwidth used by browser sessions of 40 KB or fewer can be monitored if there is a concern that network performance might be adversely affected.
More From pstilgoe
Auto populate your InfoPath form with the current user name
By peter.stilgoe
You want to a user file in your InfoPath form to auto populate with the current user who is logged on, follow these steps:
1) Create a new form by Designing a New Form Template
2)Choose blank form
3) Add a text box to the form (Field1)
4) Go to Tools | Form Options
5) Go to the Open Behavior section and click on Rules
6) Add Action to Set a Field’s Value
7) Choose the field you added above as the field to populate
8 ) For the value, click on the Fx button and choose Insert Function
9) View All in the Categories drop down
10) At the bottom you’ll see userName, pick it
11) The formula that gets dropped in is userName()
12) Preview the form, you’ll see your UserName in field1
More From pstilgoe
InfoPath Performance Tips
By peter.stilgoe
Upgrade to IE7 on the desktop. There are performance benefits to moving up to IE7. In some cases the difference is 5x to 10x.
Make sure the IE cache is big enough so our necessary 250K of content and scripts needed for the browser to render Forms Services forms – doesn’t get pushed out the cache after an initial download. Customers with extraordinarily low thresholds (like ~1MB) will have issues. Disk is cheap, increase that value to something reasonable like 10% of disk.
A good perf trick is to populate dropdowns via an XML file (especially if they are somewhat static) that is made a part of the form XSN. We can cache that on the server and get good load performance optimization. You can always republish the solution when the data changes.
If you have to download data via a data connection for a dropdown list or calculation, try to dynamically build a filtered query (via code) so that you are as efficient as possible with what you are retrieving.
Try to minimize On_Load activities like queries unless absolutely necessary.
Conditional visibility logic has some known performance problems. A hotfix is available http://support.microsoft.com/kb/937206, which is manifested in a modifed 250K initial download when accessing Forms Services the first time. The performance issue is related to the IE Script Engine and occurs at the browser level, not server-side.
Instead of using conditional visibility logic, try implementing multiple views on a form. Splitting complex views into more than 1 view provides noticeable performance improvements.
Rich Text controls are noticeably slower in IE vs. Firefox, because Rich Text editing in Forms Services is an IE-only feature. Limiting the number of Rich Text controls shown in the same view can really help form performance.
Try to prevent unnecessary roundtripping between the form browser and the server. There are several round trip switches available on controls. See the Browser Forms Tab on a given control to expose finer-grained options over the behavior. Note what the warning messages you receive say about the form’s potential round trip behavior when admin deploying the form. It will tell you when multiple server roundtrips will be likely to occur when using your form.
If you have to do roundtrips to the server, try to have them triggered by buttons, so that the users know they initiated the wait themselves. This UI trick can tend to reduce user dissatisfaction with the form performance.
Try not to treat an InfoPath form as a full, rich VB application. It’s not designed to be performant in that use case.
The more declarative logic (heavy use of rules, etc.) and managed code you have in the form, the slower it will be. Try and follow the KISS method if at all possible (Keep it Simple, Stupid).
Consider breaking out the server role of Forms Services to another machine on the MOSS farm. Services such as indexing and query serving, or high file I/O operations can really impact the ability of Forms Services to get a time slice and perform properly.
More From pstilgoe
Formatting Text / Questions in Sharepoint Surveys
By peter.stilgoe
If you have ever tried to format text and / or insert line breaks into your questions in sharepoint surveys, you’ll know its not an easy task. However by adding some simple javascript you can format the text in your questions as you want.
Basically at the bottom of your survey page add a Content Editor Webpart & insert the follow script:
You will see the script is mapping your HTML standard HTML command to keywords to trigger your formatting.
So say you wanted your question to appear in italics, you would edit your question as normal but insert the italic keyword triggers ie.
How old are you?
To appear in italics you would write the question as:
startitalic How old are you? enditalic
Now your question will appear in italics and so on……..
If you cant edit your survey page to add you CEWP see the previous post on how to edit this page.
More From pstilgoe
Need to edit a sharepoint page but there is no edit option
By peter.stilgoe
You need to edit a page in Sharepoint but the ‘Edit’ option is greyed out for example on a survey page.
Simply append NewForm.aspx with ?ToolPaneView=2 so it looks like
You now have your page in edit mode so you can add webparts etc
More From pstilgoe
How to create a good Sharepoint Survey
By peter.stilgoe
■Do the respondents feel comfortable answering the questions?
■Is the wording of the survey clear?
■Is the time reference clear to the respondents?
■Are the answer choices compatible with the respondents experience in the matter?
■Do any of the items require the respondent to think too long or hard before responding? Which ones?
■Which items produce irritation, embarrassment, or confusion?
■Do any of the questions generate response bias? Which ones?
■Do the answers collected reflect what you want in regards to the purpose of the survey?
■Is there enough diversity in the answers received?
■Is the survey too long?
■According to your test audience, have any other important issues been overlooked?
More From pstilgoe
Charting Data From Sharepoint Lists
By peter.stilgoe
If you’re frustrated by the lack of charting ability in Sharepoint / MOSS take a look at Visifire
Using Silverlight, The Dataview Webpart & Visifire you can start charting your list data within minutes with some very smart charts!
More From pstilgoe
Save site as a template – missing on publishing sites
By peter.stilgoe
If youve tried to save a publishing site as a template in Sharepoint you will notice the link isnt there. However an easy way around this is to simply append: /_layouts/savetmpl.aspx to the site URL ie
/PATH/TO/SITE/_layouts/savetmpl.aspx
More From pstilgoe
K2 Blackpoint now supports Windows 2008 server & SQL Server 2008
By peter.stilgoe
Now K2 blackpoint is supported on Windows Server 2008 and on SQL Server 2008! The KB470 update just released on the K2 customer portal provides this support. KB000470 updates all K2 blackpoint 0902 version 4.9040.1.0 installations with latest product hotfixes. The installer will update K2 blackpoint 0902 32-bit and 64-bit installations.
More From pstilgoe
Sharepoint calculated column more date / day calculations
By peter.stilgoe
Avoiding Saturday & Sundays if you were sending out alerts for example:
=IF([Call due day]=”Saturday”,[Call due date]+2,IF([Call due day]=”Sunday”,[Call due date]+2,[Call due date])
Displaying the day as text:
=TEXT(WEEKDAY([Due Date]),”dddd”)
Say you have a date in US format and you want to convert it to UK format:
=TEXT([Your Date Field],”DD-MM-YYYY”)
More From pstilgoe
Sharepoint Calculated Column – Tasks Due This Week
By peter.stilgoe
To show tasks due this week, create the following 2 calculated columns:
Week start (Monday)
=[due date]-(WEEKDAY([due date],2)-1)
Week end (Friday)
=[due date]+(5–WEEKDAY([due date],2))
Create a view where:
Week start is less than or equal to [Today]
AND
Week end is greater than or equal to [Today]
More useful scenarios here:
http://www.myriadtech.com.au/blog/Alana/Lists/Posts/Post.aspx?ID=8



September 24th, 2009
