Archive for January, 2008

Delete InfoPath Form from Script Code

Posted in InfoPath, Sharepoint on January 29, 2008 by sidersdd

A pattern I’ve seen appear multiple times with InfoPath solutions is around having two document libraries store the forms.  One typically serves as a drafting area, and the other serves as an approved or archived area.  This is typically done when security requirements dictate having two separate access lists for each library.  At some point during the life of the form it needs to move from one library to another.  The key here is move.  You don’t want to find it in both places.  It’s pretty simple to set up two data connections for submitting an InfoPath form, and have rules or code dictate which connection to use for submittal.  However, there’s no out-of-the-box functions for removing the InfoPath form from a library it was previously saved to.

One solution to this problem is to use the Scripting.FileSystemObject.  This class has a DeleteFile method and can use a UNC path to the file in a Sharepoint library/folder to delete the file.  However, the FileSystemObject class comes from an ActiveX component which is not marked as ’safe for scripting’.  Best practices for InfoPath development indicate you should avoid referencing these types of components.  InfoPath relies on Internet Explorer security settings as part of its security model.  By default all zones (Internet, Intranet, local) except for Trusted Sites do not allow execution of unsafe ActiveX components.

An alternate solution is to use the XMLHTTP class.  This class comes from a component which is marked as safe, and uses HTTP to perform the delete operation (which is typically faster than the file system approach with FileSystemObject).  Below is a snippet of JScript code which demonstrates how to use this within InfoPath:

try
{
   
// Get full URL of the current form
   
var docUrl = XDocument.URI;
   
   
// Create an xmlhttp object.
   
var xmlHttp = new ActiveXObject(”MSXML2.XMLHTTP”);

    // Delete the Working area document.
   
xmlHttp.Open(”DELETE”, docUrl, false);
    xmlHttp.Send();
}
catch (ex)
{}

Another approach a co-worker recommended was around using Sharepoint Designer to construct a workflow.  I like this idea because typically these solutions are based on a consistent workflow.  However, there are some downsides to this approach - including having to learn Designer, having “code” and logic in multiple places, and security around execution of the workflow.  I’m going to try and explore this option some more and will post some results.

Merge Documents View Missing

Posted in InfoPath, Sharepoint on January 28, 2008 by sidersdd

I’m not sure what I was doing with an InfoPath 2003 solution I was working on today, but somehow the “Merge Documents” view in the form library I published it to on a Sharepoint 2007 server disappeared. 

 mergedocumentsmissing.png

I double-checked the “Enable form merging” option within the Form Options of InfoPath, and it was checked. 

mergeformscheckbox.gif

In fact, when opening a new instance of the form, the Merge Forms option was available.  The view was just missing from Sharepoint.

To resolve the issue I simply unchecked the option, published the form, then rechecked the option and published the form again.  The view then magically appeared.

mergedocuments.png

Dundas for WPF (Not)

Posted in WPF on January 24, 2008 by sidersdd

Yesterday I talked about finding a link to a Dundas page that talks about their exploration of implementing their chart components in WPF.  After viewing their Flash based demo, I fired off an email to inquire more about their progress in the WPF/Silverlight space.  I received the following email response.

Thank you for your question regarding Dundas’ plans for WPF. 

At the moment, we are focusing our development efforts on the best technology available for helping our clients build robust Digital Dashboard solutions.  With this in mind, our primary development efforts remain in .NET, SQL Reporting Services and SharePoint 2007.  Although we have been investigating, testing and developing with WPF extensively, we don’t feel it is the best suited technology at the moment. 

We do not currently have a public roadmap for any WPF releases, however when this becomes available, we will ensure that you get immediate access to it.

It doesn’t look like we’ll be seeing a WPF/Silverlight marriage with Dundas in the short term.  This is unfortunate because I really like the Dundas suite of tools and I think there are scenarios where charting can benefit from the richness that WPF provides.

Dundas for WPF

Posted in WPF on January 23, 2008 by sidersdd

A co-worker sent me this link today:
http://www.dundas.com/Technologies/New/WPF.aspx

It talks about Dundas’ next generation of charting technology being built using WPF.  The weird part is there is no link to this page from anywhere on the Dundas site that I can find.  If you read the first paragraph it sounds like the page was written over a year ago.   I’m very interested in this space - charting with WPF and Silverlight.  Dundas seems to be rather quiet on their roadmap here, whereas Infragistics is moving along quite nicely with their xamChart component in the NetAdvantage for WPF suite.  The Silverlight pieces are lagging a bit, but the assumption there is that they’re skipping putting the effort into Silverlight 1.0 and focusing more on Silverlight 2.0.

If anyone has information/links about charting visualizations with WPF/Silverlight, or the vendor roadmaps, please send them along, or post in the comments.

Troubleshooting TFS Data Warehouse

Posted in TFS, VSTS on January 18, 2008 by sidersdd

I was troubleshooting another issue with reports from Scrum for Team System, and came upon a better link that explains troubleshooting the TFS Data Warehouse.  It includes steps for rebuilding the warehouse using the web services.

Sprint List Not Updating in TFS Report

Posted in TFS, VSTS on January 16, 2008 by sidersdd

Recently I had a problem with some reports that are part of the Scrum for Team System add-in for TFS.  The drop down list of sprints in the Sprint Burndown Report was only showing a subset of sprints defined in the system.  The reports consume data from the TFSWarehouse database on the TFS server.  So I looked there to make sure the warehouse was being updated.  Querying the [Work Item] table revealed that the warehouse tables were in fact not being updated.  The only sprints found in that table were the ones showing up in the drop down list in the report.

Next step was to figure out why the warehouse wasn’t updating.  I peeked into the event log on the TFS server and found the following error in the Application log:

TF53010: An unexpected condition has occurred in a Team Foundation component.

Detailed Message: TF50801: The TFSServerScheduler service did not initialize. The Team Foundation Registration Service returned the following error: The registry for this computer either has no entry for, or contains multiple entries for, Team Foundation Server.

The part about ‘multiple entries for Team Foundation Server’ was key.  In the registry there is a key which lists the known TFS servers - - HKCU\Software\Microsoft\VisualStudio\8.0\TeamFoundation\Servers.  Sure enough, on this TFS server there were multiple entries found.  I’m guessing the extra server entries found their way in there as I was testing the TFS-to-TFS Migration Tool at one time.  I removed the extra entries, and left the one which referenced the current TFS server.  I then restarted the server to ensure this fixed the starting of the TFSServerScheduler.

Next task was to force a rebuild of the warehouse.  Steps for this can be found here.  I followed the web service steps.

Once that was complete, I verified the sprints were listed in the query, and then verified the sprints appeared in the drop-down list in the report.  All was working fine now.

Hello world!

Posted in Uncategorized on January 15, 2008 by sidersdd

I had originally planned on starting this blog last year.  Too many other tasks consumed my time.  So it’s now a 2008 New Year’s Resolution to begin this blog.  The intent of this blog is to record, communicate, and share on a variety of technical topics I’m focused on - primarily in the Microsoft development space.  Posts will probably vary from those related to VSTS, WPF/Silverlight, Office, Sharepoint, K2, and other general .NET topics. 

Hopefully the sharing of content on these topics benefits other individuals.  I know at the very least this blog will help me when I need to look back in the archive and remember how I solved a particular problem, or when I’m in the mood for reminiscing about what technologies I was investigating at the time.