Status Reports in InfoPath (Part II)

Due to the overwhelming number of requests (3+) for screenshots and code for the Status Report described in a previous post , I’ve decided to make them publicly available. My only request is that you let me know how I can improve the form.

Here is the “Individual View”:

It uses a Master-Detail control for viewing multiple Status Reports at once.

Here’s the “Team View”

It groups things by section, rather than by person. I had to use a secondary data source and some scripting to get this to work. Perhaps someone can come up with a more elegant solution.

Here is the original form template. Also included are the two data sources (Access databases) that the form depends on.

A couple of notes on running this form:

I created an access database for the form to run in, but the form is currently hardcoded to look for the Access DB at C:\StatusReport\. Unzip the files to that location for the form to run properly. When you deploy the form to users, you should put the Access DB in a shared location, or use SQL Server.

The original form uses a Web Service to get the current user name. I had to remove this in order for this form to be functional, and I replaced it with a call to the WScript.Network ActiveX control. Unfortunately, this ActiveX control is unsafe, and requires the form to be Fully Trusted. Until you get your own web service written, you can test the functionality of the form by opening it in the Designer and Previewing.

I’m really interested in looking at this, but after I save the 3 files to c:statusreport , and opening the XSN file, it throws an error that says "this page is accessing a datasource in another domain. Do you want to allow this?"… I say Yes, and it returns "Infopath cannot create a new, blank form. InfoPath cannot open the form. To fix this problem, contact your system administrator."

I’d imagine you’re running into the second issue described above, but I’m not sure. Is there anything else written in the error message?

In the meantime, try opening it in the designer, and then previewing the form.

When you actually want to deploy this to users, you’ll need to either write a web service to get the current username, or you’ll need to make the form fully trusted in order to run the unsafe WScript.Network ActiveX control.

Either your codepage is causing problems, or (more likely) I created the database and inadvertantly got something from the Japanese codepage in there. I’ll see if I can update the zip file tonight, and perhaps this will solve the problem.

On another note:

This form won’t work in its current state on Windows XP SP2. There seem to have been some security fixes which prevent the form from accessing the mdb files on the local machine from the form. In addition, the WScript.Network object has been locked down as well, even when opening from design mode.

2 workarounds:

1. Remove the EmpData data object from the form, since all it does is populate the manager and team name automatically for you based on the user. You’ll need to do some updating of the form code to remove references to EmpData, as well as the WScript.Network object (I’ll try to upload a separate ZIP file with these changes tonight)

2. Publish the form out to a network share (or share the c:StatusReport directory, and republish to the UNC path) This way, the mdb files and the form template are seen as being on the same security domain, and will be able to communicate without error. In addition, add the share to IE’s Trusted Sites, so that the WScript.Network ActiveXObject can be created.

If you just want to try out the form, see the code, but you don’t care if it’s functional, I’d recommend workaround #1. If you actually want to play with the form, try out the functionality, etc. I’d recommend workaround #2.

I receive the following error when attemtpting to Access a published InfoPath form in SharePoint. This does not happen on my PC, but on other PC’s that are attempting to display the InfoPath Form. Of course, my PC works fine everytime.