Saturday, June 16, 2007

OpenOffice XForms and Bindings

Good news! In my last post, I complained about OpenOffice's lack of control when dragging elements from the data navigator to your document window to create bindings automatically. It seemed that you were limited to a LabelField and TextBox, and you could only replace the TextBox with a limited number of controls.

Further research has shown me that these two controls are actually grouped together - hence the lack of control over them. I found that you can ungroup them and you have two separate controls, and can then replace the TextBox with whatever you want.

Here's an example of how to do this in OpenOffice. I'll use the "patient.birthday" which we'll need to change to a date field. (Note that the following screenshots are from an awesome program called NeoOffice, an OS X port of OpenOffice that currently uses version 2.1. I've been trying it out, and so far it seems really really cool.)
1. Drag an element from the data navigator to your document. It will look like this:

2. Ungroup the controls. This can be done via Format | Group | Ungroup, or by adding the Ungroup button to your toolbar:

3. You can then click on the individual controls and edit them. Here we'll replace the TextBox with a date field:

4. You can make a pretty calendar-like date select field by setting the "Dropdown" property to "Yes" (thanks to omarc55 for this tip!):

5. All of your XML data from the schema should be there:

6. You can now also change the LabelField to read something more user-friendly like "Date of Birth:".

I'm pleased as punch to have found this. It should make creating this forms MUCH easier. It also opens up form creation to the less technically-inclined people out there.

1 comment:

Emam said...

thanks for your post. but when will we get the rest of the tutorial.
thanks again

Emam Hossain