User-defined forms. (To print)

Okay, what I am looking for probably exists already in many shapes so I'm just asking this to find the best solution for my problem... Long story, so please read CAREFULLY! What I need is at the end but don't skip the rest...

I am working on an application for an organisation where they need to design custom forms that are then printed with data from all kinds of sources. It will actually be made of three parts.

The first part is where the user can design their own custom tables, complete with queries, calculated fields and a lot of other stuff. I will be using dxMemData components from DevExpress for this, and these tables will be stored as blob fields inside another database. It's a complex way to work with a database but this is how this organisations likes to see the whole thing being designed. Getting this to work will be tough, though so I'm still trying to fast-talk them into a better solution but they don't seem to listen to reason. (And they pay by the hour so I don't care if it will take me years to finish it.)

The second part is where a user is designing forms that are linked with the custom tables that they have created. These should be just some kind of simple reports or some other solution. Problem is, it is a form that is used for data entry, with comboboxes, checkboxes, images and several other controls on it. And the designer of this form will be putting these controls on the form, test it, check if it's working okay, etc. The biggest problem with this is that it must be printed exactly as it is shown onscreen.

The first two steps are done by users with administrative rights. The third part is for all other users, which is basically that they select a form, enter data inside the form and then print this form to a printer, fax driver or send it by email as RTF/HTML email. They are not allowed to make any changes to these forms, nor are they allowed to make changes in the database. So basically it's the administrator who sets up the system with correct data and forms and who is responsible for maintaining it. And the users will just be making selections.
For example, the user might use such a form to generate an order form. They select a customer, select several articles and the form would show them the invoice which could then be printed or manipulated in some other way. Saved as RTF or maybe PDF even. Sent by email, stored in some document management system or whatever.

Now, the database system this monster needs isn't a problem. Nor is combining the form with data. My problem is allowing the user to design these kinds of forms. What would be the best way to do such a thing, without the dependancy of external report designers or whatever.

My first idea was QuickReports but that would be just too complex. Besides, QuickReports just has too many quirks and bugs to my liking. It's not reliable enough. Rave reports or Crystal Reports aren't options either because they require additional software. The organisation will be using very thin client applications so the user would only need to copy an executable to their local system to get it all working. Installation of an additional report designer is out of the question.
Another idea was to include some kind of spreadsheet component. DevExpress has an interesting one and it's advantage is that it can do all kinds of formula's. All I need to do next with it is allowing the user to add all kinds of controls and make sure that the end user (who is just using it to generate the final document) cannot alter anything in the form, except for those parts that the administrator left open for them.
Also considered using WPTools and just let them generate RTF files as forms. That would also be a good solution. The form would then have all kinds of preset fields and all the user has to do is provide the correct values. But with WPTools it's a bit difficult to have those controls in the document itself.
Or perhaps some HTML editor. The solution I am looking for does resemble the functionality of a webpage a bit. The user sees a page with all kinds of controls and can manipulate it in all kinds of ways before pressing "submit" to have it all processed. Unfortunately, I have to assume the administrator is totally clueless about HTML so I would need to provide a good HTML editor for them, with some additional custom data controls...

So I am looking for some good form designer for printable forms. It must be easy to use yet pretty powerful. I like the HTML idea but have to assume that even the administrator for this system has the brain capacity of a chimpanzee for this project. It sounds funny but unfortunately this is the reality too. The users of this application will not be any highly trained IT experts.
LVL 17
Wim ten BrinkSelf-employed developerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The major problem with customisable software is the customization, which must be sooooo simple for the non-expert user that, basically, it can't go wrong. Furthermore one needs the ability to "test and derive" before deployment which often leads to complex content management.

The next problem is system consistancy. The major problem with many tools is that the tool produces the end product and getting a conisitancy across the produced system depends mainly on discipline in using the tool or tools in one way only.

I'd start therefore at an abstract level of form design and give the users that as interface.
This abstract form level has a language, ie: a set of terms which correspond to those features required but without any form of GUI. The best language to use is a private language and that implies XML. The users will use any tool whatsoever to produce a small XML file containing the description of the fields of the form.

I'd use a web server to serve up the forms. The incoming request - consisting of the form to be fetched and any parameters for pre-loading it - would be processed by a script which would transform the XML into HTML/Javascript to be sent to the browser. The GUI is then browser based, which is vey thin. The HTML/Javascript fetches the data from the database, displays it in the form (again XML DOM objects can call-back the server for teh data).

The transformation of XML (and indeed data) occurs using XSLT. Now the advantage of XSLT producing HTML is that you get consistancy, is easily changeable and by also using CSS you can easily change appearance. By using different sheets you can generate XSLT-FO for printing (that gets transformered into things like pdf), or even simple plain text for e-mails, sms messages and the like.

Is that any help?
I hope I've had enough coffee to lend credible remarks and suggestions.  If not, ask me for explanations.

I see major problems centering on the lack of standard meta-data for these user tables.  You would likely help your case, by creating a process that will transform the user's BLOB table into a real temporary table structure when they are actively working with their table.  When they have finished, reverse the process (updating the BLOB field with meta-data changes and data changes).  Then delete the temporary table.  At least that opens up a lot of options for off-the-shelf solutions.

I would urge you to look at the XAML standard for defining forms.  This can also be stored in another table, keyed to the user and their database.

* If you were working with a database like SQL Server, you could automate the script that exports the definition and data of the a table.  These (generated script) SQL statements could be easily stored in the BLOB field.  This seems the easiest solution.

* The fastest possible performance would derive from a wholesale storing/retrieval of the binary image of the user's database.  You might be able to use a table (or database) backup file.
Wim ten BrinkSelf-employed developerAuthor Commented:
Interesting suggestions, but there are a few problems that I have to deal with, starting with a bit stubborn customer who fortunately doesn't care about how long it takes, as long as something comes up. You got to love such assignments, though. :-)

The whole system will be client-server based but due to the complexity of the client-sde requirements, I can't just stick to simple webdesign. For example, the client side must be able to scan images from a local scanner and it's linked to a printer driver that will send some printed output as an image to the client application. All kinds of complex calculations also need to be made too, making it near impossible to do just in some webbrowser shape.
Am not using webservices either for this solution but custom TCP/IP connections between client and server. Compatibility with other development systems? Not important.

The idea of using XML to store the forms is interesting but actually I don't care as what type the forms are stored. Storage isn't the real problem, providing the administrator a simple-to-use GUI is. They want a visual designer like the Delphi's form editor in the IDE. I am pretty familiar with XML/XSLT and how it can be used. Problem is, I can be familiar with it, the administrator who will be using this application definitely isn't familiar with XML or XSLT. This administrator isn't an IT specialist, but just (for example) the manager of a group of salespersons. The kind of people who complain their computer doesn't work because they forgot to turn on the monitor too...

About those user-defined tables. I'm not too worried about them. Only the administrator will be allowed to make changes and I can prevent multiple users modifying the same table. Besides, the normal users only have read access and the tables will be reasonable small in size. It is quite possible to just download those tables on demand.

XAML sounds interesting but unfortunately I have to support W2K too. I'm actually developing on W2K for this project. And the use of .NET is out of the question too. I have to stick to Win32 development for this project. But XAML does look like something I am looking for: a way to design user interfaces and link them with multiple datasources. But as I said, I am looking for some solution that would allow the user to design them graphically, WYSIWYG preferably, and from within Delphi.

About the database that is used by the back-end, right not it's FlashFiler from TurboPower but we're planning to make the client database-independant. Still, SQL Server probably won't be one of the databases in the back-end.
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.


The have a form editor that is very similar to Delphi. And uses delphi compnents. It also can allow scripting in several languages, a Delphi like language, VB, and more.

Take a look a their sample program Instant Report that they created using their components that looks a acts like the delphi IDE.

We use this as a way to have custom forms created with added script logic to events added to our application without having to use DLL's.

Wim ten BrinkSelf-employed developerAuthor Commented:
A collegue of mine actually redirected me to which seems to be what I need. But that dream company also seems to have some interesting products. Makes it a bit hard to decide, though.
However, Dream seems to be especially for creating dialogs and Delphi forms while WPForms is more for printable documents. Therefore, WPForms seems to more favorite in my opinion. But are there any other alternatives?...
>>You got to love such assignments, though. :-)

Quite the opposite. They make me make design decision which I regret later.

>>For example, the client side must be able to scan images from a local scanner and it's linked to a printer driver that will send some printed output as an image to the client application. All kinds of complex calculations also need to be made too, making it near impossible to do just in some webbrowser shape.

We use WebTwain for this and various print services for the other. Everything input gets sent to the server. You can always write and sign an ActiveX component to do the odd job. Delphi makes this relatively easy.

>>Am not using webservices either for this solution but custom TCP/IP connections between client and server.

Which means you invent your own protocol on your own ports. We have customers who put their servers in locked rooms and put a firewall between their in-house LAN and the server!

>>This administrator isn't an IT specialist, but just (for example) the manager of a group of salespersons. The kind of people who complain their computer doesn't work because they forgot to turn on the monitor too...

Then it is illusionary to assume that you're going to find a way to allow them to actually do what they think they are capable of. I know it is very difficult to convince them otherwise, but it is extremely difficult to make a system which is so flexible that customers can do literally anything.

We have been down this route already. The old app consisted of 12MB of Pascal/C source with 100+ forms. It was classic client/server the TCP/IP interface connected app to a Codasyl database. The problem - how to allow an ever expanding functionality without forever building in options to switch this on and that off? How to do this cheaply and how to maintain it. The answer: Web browser serves as thin client - use IE since MS owns desktop, use XML to communicate between form and server. Use HTTP (goes though most firewalls with ease), use Apache, and use an App server. We started too early and missed out on TomCat. We use RatScript instead which has the advantage that I can deny database updates to our customers - must have system password. Customer can use simple HTML with smart tags for the fields he wants to read/update. Very few customers actually use the tools, so we get continued business for small changes/enhancements.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Wim ten BrinkSelf-employed developerAuthor Commented:
BigRat, sometimes it just helps to let your manager read some comments about his idea by independant developers. :D You made some good remarks so he concluded that he just forgot about this "interesting" idea of him. The project died anyways. :)
Gott sei dank!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.