Alpha Software is focused on enabling developers to create robust, data-driven business applications that run on any PC, Tablet or Smartphone in the fastest, most efficient and cost-effective manner possible.

Share this blog:

Thursday, May 05, 2011

How PrintHTML lets you create multiple sub-reports with ease in Alpha Five

For developers looking to get their hands dirty in their reporting toolkit, I've got your dirt. I've recently been working with a function that helps you create more sophisticated report layouts in Alpha Five. It lies in a simple function that's been a part of Alpha Five's Xbasic language for some time, but is often overlooked: the PrintHTML function.

This is important because one of the requirements that needs to be addressed in application development is the ability to create multiple sub-reports with your reporting tool. Sub-reports provide us a way to print information from child tables (e.g. invoice detail, payments, notes, etc.) related to the parent table (e.g. invoice header) in multiple different formats.

This has been available in Alpha using "Sets" when based on DBF files. Unfortunately, DBFs are not the best option for professional applications for a number of reasons (a topic for discussion at some other time). But RDBMSs (MS SQL Server, MySQL, Oracle, etc.) cannot currently be used in a sub-report in the current Alpha Five report writer.

However, once again Alpha provides a way to solve this problem.

The video shows a technique that not only gives you some incredible fine grained control of your layout, but also leverages existing HTML coding knowledge. What appears to be a rather simple little function -- PrintHTML() -- opens some seriously powerful capabilities for any developer's reporting toolkit. In short, you have complete control of your layout in any given segment of your report.

If you can design it in HTML, you can display it on a report. In my video, this particular customer has a "boilerplate" need. We merge both HTML information stored in the event header table, with detail (sub-report style information) from the Event Detail tables to create nicely formatted proposals, contracts, and invoices.

In addition, there are performance and flexibility gains by moving the initial creation of HTML and layout information to the SQL Server rather than Alpha as shown in the video. So hit play to see how it's done.

0 comments :

Related Posts Plugin for WordPress, Blogger...