.
 News & Views
  The online information source for iSeries and mrc-Productivity Series users
.  November 2002  
Volume 2, Issue 11  
.
. . . . . . . . .

Tech Corner

Effectively using the Web/CGI Header/Detail/Footer Template

by Brian Crowley
An application designer often wishes to create applications that contain header and detail information together. Examples of header/detail applications abound: sales orders, purchase orders, invoices, EDI transactions, etc.

The mrc-Productivity Series offers file joining and SmartLinkedTM individual applications for creating unified applications when working with header/detail information. Now, with the Web/CGI Header/Detail/Footer Template, mrc-Productivity Series users have another powerful technique for working with this type of information.

To illustrate this point, consider a simple sales order header/detail application. The header information might contain these database fields: order number, customer number, customer name, and order-level dates. The detail might contain these fields: product number, product description, and quantity ordered.

Click here for larger image
Figure 1

Figure 1 shows the example application created with the standard Web/CGI multiple-record template. Because this application is displaying order detail information and order header information together, the header information repeats as the same information on each line. This might be acceptable, but it could be preferable to display the header fields once as information above or below the table.

Click here for larger image
Figure 2

Figure 2 shows the same application built with the Web/CGI Header/Detail/Footer Template. To tell the mrc-Productivity Series which fields to place in the header (above the detail table) and in the footer (below the detail table), this template checks the User-Defined Field in the Preformat Screen. The top three fields are specified with 'H' and the last three with 'F' in the User-Defined Field on the Preformat Screen. Fields to be displayed in the detail section are left blank in the User-Defined Field as usual.

The Total Pieces Ordered field is a calculated field called a running calculation (often used in reports): CALC1=QTYORD+CALC1 (CALC1=&8+&9) where this calculation is the ninth field of the application and field QTYORD is the eighth field. The standard template just displays this field as the running total for that column, but the Header/Detail/Footer Template shows it once, as the complete order total, in the footer section.

Of course, like the detail section, the header and footer sections can be painted after generation. This can give a very professional look to an application that can be created in a matter of minutes. The footer section could be painted so that the fields from the detail table you'd like totaled would be the last row of the detail table. That technique would be especially useful if you had several fields you wanted to total.

An application built with this template is intended to be SmartLinkedTM to. It needs at least one key field passed to it to work properly. So, in this example, it would be appropriate to create an application that lists a set of sales orders. That application would then SmartLinkTM to this order/detail application. Mainly due to this limitation, this is not a standard template that you will get with an updated version of the mrc-Productivity Series. However, this template is freely available from our online template repository.

You can download the two special templates from the members-only area of the mrc website:

http://www.mrc-productivity.com/members/software/template.html.

The templates are named R8RETCGHF1 and R8RETHCGH1.

After downloading and installing each template, you will need to create a new mrc-Productivity Series C/S template type. Detailed instructions for that can be found here: http://www.mrc-productivity.com/members/newsletter/may00.html#techarticle.

Here is the template definition for the Web/CGI Header/Detail/Footer Template:

Server Program Template = R8RETCGHF1
Client VB Project .MAK /HTML = R8RETHCGH1
Client VB Startup / Java = MRCCGIDFT

As always, if you need help getting an application working properly, please call the mrc hotline for assistance. This template was made as part of a small consulting project for an mrc customer. If you have an idea for another special template, please contact the mrc hotline to see if that special template already exists or if one could be made for you.



Take Our Poll

Is the IT labor shortage exaggerated by industry analysts?

Yes
No

View Results
View Poll Archive

.
.
.
.
. Quick Links...

Visit mrc's Web site

See a live demo

Get more information

View Latest Newsletter

Last Month's Newsletter

.
.
.
.
. Contact mrc...

U.S. Offices
mrc@mrc-productivity.com

voice: 630-916-0662

www.mrc-productivity.com



U.K. Offices
michaels, ross & cole (UK) ltd

voice (UK): +44 (0)20 8282 1600

mail@mrcuk.com


.
 mrc publishes this newsletter on a monthly basis. Subscription is free of charge. Please send any questions or comments about this newsletter to news@mrc-productivity.com. This newsletter is edited by Heather Gately.

To unsubscribe, please just reply to this e-mail with Unsubscribe in the subject line.
View our privacy promise.

.