Tuesday, March 16, 2004

Finally I have installed SP1 and the toolkit of Infopath 2003.  I know, I'm maybe late, but I didn't have time before.

But first.  If you are using the first time Infopath, it may be interresting to check the MSDN site because there are some good articles on it, like the programming model.

OK, now a bit more about the SP1 and toolkit.  If you want to use the toolkit, you first have to install the SP1.  Although it isn't really a SP, but more a newer version of Infopath.  So I just run the exe, and I already got my first error message, which told me to uninstall the previous version first.

After uninstalling the first version, I installed without any problem SP1.  I also directly installed the toolkit.

Before running the toolkit, I just have to see what the changes are in SP1.  Well one of the changes you directly see, is the project screen

Another big advantage is, that Infopath SP1, now is a standalone application.  You don't need Office 2003 or the relase version of Infopath 2003.

A short list of other items I found out :

  •  Improved schema support
  •  Xpath improvement, like calculations without writing a script. So I can use formulas instead of my calcfunction I wrote before. 
  •  Digital signatures
  •  Improved ADO support
  •  Printing improvements like page breaks

A total list of new/imrpved items can be found at the download page of the SP1.  Next, I re-opened my previous template.  Directly I got the question if I want to upgrade my template to the new schema possibilities.  If not, users don't have to upgrade their Infopath.  if you choose to upgrade, then all your users must also upgrade to Infopath 2003.

My next step is using Visual Studio 2003 to creat my Infopath forms.  I will start from zero with my holidaysheet.  More about this in my next post.

3/16/2004 9:41:23 PM (Romance Standard Time, UTC+01:00)  #     | 
 Thursday, March 04, 2004

OK, Jan already did a post about this event. But at the customer where I was today I didn't have an internet connection :'( (at htis moments you know what you're missing).  And as you can read futher, I didn't want to update my blog late this night (or morning).

But, yesterday I went to this event, where three speakers come to talk about, mostly, Sharepoint and Infopath.  First we had Yves Kerwyn.  he talked how to use the underdog program Frontpage to create your teamroom layout (or change).  I only can say, yves is in really love with Frontpage 2003 (What is your wife telling about this ;-)).  And I was amazed what you could do with this product.  Then, Jan Tielens came on stage.  He talked about the development of web parts.  Within a short time he created some simple webparts, which shows us a lot of possibilities (even connectable webparts where included).  Jan had also some nice tips for us.  And last but not least, Patrick Tisseghem.  he showed us the new infopath toolkit.  And as you could read before in my Blog, I will try this also as my next step.  I was amazed that when Patrick asked who already have downloaded this toolkit (togheter with the SP1), and who already programmed in it, that nobody else (except me) in a room of 90-100 people raised his hand.  Or nobody wants to say, that's also possible.  At the end Patrick, showed also some forms published in sharepoint.  And we learned that there is a Sharepoint space, where documents can disappear and never appears again (just like a black hole in space, but now in Sharepoint).

Afterwards there was a little drink the hotelbar.  When this was over, we went with 8 people (Patrick Tisseghem, Yves Kerwyn, Inge ?, Tom Mertens, Wim ? and two others (one guy and a girls form U2U who's names I forgot) to 'Den Uiver' for a good talk and discussion, we even talked about Lotus Notes (or must i say Lotus Klotes -> PS : This is my own opinion).  A sad thing for someone was that there was no Guiness, no snacks because the kitchen was closed till 8 march and when we ordered 4 little bags of chips they said that there was only one.  But OK, around 0.30 we all went home.  Thanks guys and girls for the nice evening.  Hope more of these will follow. 

3/4/2004 7:05:31 PM (Romance Standard Time, UTC+01:00)  #     | 
 Tuesday, March 02, 2004

My next discovery with Infopath was to make a sommation of other fields.  Although this is very simple in other programming languages, in Infopath it isn't.  Why ?  Well, as you may know, Info uses XML to hold houw your form is build.  So when wanting a sommation you first have to get the value out of the XML for evey filed and then put the total value in your total field XML tag.

Now, first you have to decide how to trigger the function.  I have triggered it, by the "after change" event of every field I want to include in the total.

You can program the event.  This can be done by selecting the properties of the field, and then choosing "datavlidation".  When this screen popups up, you can select the event and press edit.  Now a script editor will be opened.  You can choose between Javascript and VB script.

When the VB script editor is opened Infopath has created following code for you :

///=======
// The following function handler is created by Microsoft Office InfoPath.
// Do not modify the name of the function, or the name and number of arguments.
// This function is associated with the following field or group (XPath): /my:myVerlofSheet/my:myTotalVerlof/my:TotaalVerlof
// Note: Information in this comment is not updated after the function handler is created.
//=======
function msoxd_my_TotaalVerlof::OnAfterChange(eventObj)
{
// Write code here to restore the global state.

if (eventObj.IsUndoRedo)
{
// An undo or redo operation has occurred and the DOM is read-only.
return;
}

// A field change has occurred and the DOM is writable. Write code here to respond to the changes.

}

 Most of this code you don't have to change.  The part in red can be changed by your code. In my case I call a function "CalcVerlofTotal".  This function will do my sommation.  No when going into the details of this function.  First I had to find out how the get the value of the fields.  So I needed an XLMDom document, so I can use the selectSingleNode.  But how was I going to define which node I want to select;  Well now I came to my previous part : Infopath - datasources [Put link].  As you can remember I had several groups.  Well to go to the correct node, you have to do two things :

  1. First find this line : "XDocument.DOM.setProperty("SelectionNamespaces", 'xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2004-02-10T19:53:49"');"  Here you can see the red word (could be different).  this is important.
  2. Next you have to now you exact datasource structure.

So when we want to go to the Verlof2003 field this is our node :

/my:myVerlofSheet/my:myTotalVerlof/my:Verlof2003

As you can see, the keyword my is important.  And we take every level of our datasource to go to the exact field.

Now it's easy.  So I created for every field an object.  The next step is to create the summation.  So I created a variable nTotaal, which will store the result for me.  Don't make my mistake, because first I just took the nodevalue of every object : "myVerlof2003.nodeTypedValue" and add here the value of my next object.  it will work, but's wrong.  You get following result :

As you can see, there's is no summation done, but the systems concatenates the values as strings.  So after some searching I found out, that you have to do some typecasting.  So, to cast the value to integers, just use the function number.  this gives us following : "Number(myVerlof2003.nodeTypedValue)".  And when adding all the values now to each other, we got our correct result.

to complete this part here's the full code of my function :

/*------------------------------------------------------------------------------
CalcverlofTotal
Calculates the total of all holidays an employee can have
------------------------------------------------------------------------------*/
function CalcVerlofTotal()
{
var xmlDom = XDocument.DOM

var myVerlof2003 = xmlDom.selectSingleNode("/my:myVerlofSheet/my:myTotalVerlof/my:Verlof2003");
var myVerlof = xmlDom.selectSingleNode("/my:myVerlofSheet/my:myTotalVerlof/my:Verlof");
var myADV = xmlDom.selectSingleNode("/my:myVerlofSheet/my:myTotalVerlof/my:ADV");
var myVervangendeFeestdagen = xmlDom.selectSingleNode("/my:myVerlofSheet/my:myTotalVerlof/my:VervangendeFeestdagen");
var myTotaalVerlof = xmlDom.selectSingleNode("/my:myVerlofSheet/my:myTotalVerlof/my:TotaalVerlof");

var nTotaalVerlof = 0

nTotaalVerlof = Number(myVerlof2003.nodeTypedValue) + Number(myVerlof.nodeTypedValue) + Number(myADV.nodeTypedValue) + Number(myVervangendeFeestdagen.nodeTypedValue);

myTotaalVerlof.nodeTypedValue = nTotaalVerlof;
}

Now, I had my function, the next step will not be the repeated, but I will install the Toolkit for Visual Studio.Net and try this.  So keep in touch for my experience with this.

3/2/2004 8:43:35 PM (Romance Standard Time, UTC+01:00)  #     | 
 Tuesday, February 24, 2004

Next part in my learning of Infopath.

Normally when creating a new form, when you add your fields they will all appear in de Data source in myFields.  Just each field under the other one.

Now, to make your life easier, especially when you have to maintian  the form later, you can create sub groups.  So I redesigned my first creation of my Holiday sheet to some good data source structure.  The result can be seen in the image on the right.

Now I'm trying to create my calculation function for my total Holidays. I will keep you informed about this.

2/24/2004 8:30:48 PM (Romance Standard Time, UTC+01:00)  #     | 
 Monday, February 23, 2004

Betaversion of Virtual Server 2004

Microsoft has released the betaversion of Virtual Server 2004 for a selected group of customers.  The full version will be availlable for the market somewhere in the middle of this year.  This VM is for Windows 2003 which can host development, test and production environment.  VM is bought by Microsoft from Connectix.
(Thanks to Datanews)

Infopath update 2

I'm not the first one, who mention this.  Some downloads for Infopath are availlable :

For more info, you can go to Patrick Tisseghem's Blog.

Common | Infopath | News
2/23/2004 5:24:07 PM (Romance Standard Time, UTC+01:00)  #     | 
 Sunday, February 22, 2004

It seems that there are two products which creates web based forms form your infopath form.  So the user don't have to have infopath on his PC. 

At this moment I haven't played with those tools, but if you have some experiences with it, let me know.

These are the links :

Thanks to Yves K. and Patrick Tisseghem's blog for the info.

2/22/2004 1:27:10 PM (Romance Standard Time, UTC+01:00)  #     | 
 Friday, February 20, 2004

Just to inform you that an update of infopath will be unveiled on February 23rd. This will be as a part of the office update.

Keep you informed at Patrick Tisseghem's blog.

2/20/2004 6:56:03 PM (Romance Standard Time, UTC+01:00)  #     | 
 Tuesday, February 10, 2004

This evening I started with Infopath, Yes I was not at the dev-days in belgium, because I had a project to finish :-((.  Now, you will find my whole learning process in my blog in the next few days, weeks or months (depends on how much time I will have).

When starting with infopath, I found it very easy to find my first steps with it.  It was just like using Frontpage.  Here's a screenshot of the clean startup :

Now you can take the tour if you want, and I would recomment this when you never have heared before of Infopath.  I contains some good common info about this tool.  You can open the sample, althought most of them aren't very usefull for the Belgium people, because it's all american.  But neverless, it can't be harmfull to take a look at them.

Now I have already a little project in my mind.  I want to redesign the holiday request sheet of our company, which is created in excel to infopath, so it could be posted on our sharepoint.  Here's a screenshot of the excel file :

Now, I'm going to redesign this sheet in following steps :

  • First create the layout of the first 2 blocks (the header block and the block with how much days we have)
  • Make sure that the totals are calculated (if possible)
  • Create the grid where we can put our holiday's in
  • Recalculate values if possible
  • Export the file to excel for our accountancy
  • Get all info from a SQL DB, when filling in a name, or use another method
  • Save changed info back in DB or use another method

As you can see , I have several steps to go.  Well the first step took me about 10 minutes. 

First I create a new template.  When the template is created, a menu is showed, where you can make the layout, choose controls,... . 

I created two tables.  Put the correct text in it, inserted our company logo and put the textfields in place (with the correct properties) where the user can fill in some values.  When adding a textbox, you can change it's values by double clicking on the textbox.

You get following screen :

You can give a name, set the data type, give it a default value and much more.  for data types you can choose out of : "Text (String), Whole Number (Integer), ..."

As you see, creating the layout doesn't take much of the time.  Now the problem comes, I want a field on the screen which has the result of the sum of some other fields.  More about this solution in the next update.

Finally, a screenshot of my first tryout with infopath.  Only the first two parts are added:

2/10/2004 9:38:55 PM (Romance Standard Time, UTC+01:00)  #     |