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:

  1. 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.
  2. 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.

If you have any questions or problems, let me know.

Comments (7)

  1. hi…

    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."

    Advice?

    Thanks!

    m

  2. Dave says:

    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.

  3. Gubus says:

    Hi!

    I have the following error:

    "Form template: file:///c:StatusReportStatusReport.xsn

    The following DataObject either cannot be created or cannot be initialized: EmpData

    The query cannot be run for the following DataObject: EmpData

    InfoPath cannot run the specified query.

    [0x80004005][Microsoft JET Database Engine] Selected collating sequence not supported by the operating system."

    There is suspicious character sequence in the manifest.xsf file (for me). At the last "adoAdapter" tag, the commandText property has a multiple &#xA sequence.

    I have default installed English Windows XP with addtional ISO-8859-2 codepage, and English Office 2003 SP1.

    Advice?

    Thanks!

    G.

  4. Dave says:

    I’ll bet you this has something to do with it:

    http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q202/1/50.ASP&NoWebContent=1

    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.

    Sorry for the confusion.

  5. Dave says:

    I installed WinXP SP2 on my home machine, and my form ran without problems.

    Go figure.

    The root of the problems people were seeing was the secondary database connection and the WScript.Network unsafe ActiveX Control

    As a result, I’ve ripped out the auto-generation of the username and manager name, but at least the form should open now!

    Here’s the updated copy:

    http://www.jdpapas.com/blogfiles/StatusReport/SimpleStatusReport.zip

    As always, let me know if you have issues running the form.

    Thanks,

  6. Sakieboy says:

    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.

    Form template: http://portalname/D9/HiMom/Another%20InfoPath%20form/Forms/template.xsn

    The following DataObject either cannot be created or cannot be initialized: SelectAllApplicants

    The query cannot be run for the following DataObject: SelectAllApplicants

    InfoPath cannot run the specified query.

    InfoPath either cannot connect to the data source or the service has timed out.

  7. Dave says:

    Not a lot of information to go on, but it looks like there’s a problem with your Data Object called SelectAllApplicants. Make sure your users can access the database or web service.