Tech Corner
Build a Web Calendar Application by Brian Crowley
Have you ever wanted to see DB2/400 data formatted in a calendar layout? With a recent template addition to the mrc-Productivity Series, now you can.
How can you do it?
All you need is this new template and a database file that includes a date field. Just sort the inquiry application by the date field, generate it with the new template, and run it from your browser.
Which dates does the template handle?
The template currently supports all of these date field types:
True Type L dates
6-, 7- or 8-position numeric fields
Single numeric field created in the data dictionary by concatenating individual year/month/day fields.
The template currently supports all of these date formats:
YYMMDD
MMDDYY
DDMMYY
CYYMMDD
YYYYMMDD
MMDDYYYY
DDMMYYYY
Options
You may update the HTML skeleton (library Data Dictionary, file QHTMLSRC, member I12345 where 12345 is the application number) with a number of options. First, you might need to specify the date format using one of the valid formats listed above. Do that where the skeleton reads mrcDTfmt=XXXXXX.
As with all mrc Web templates, you can use the HTML skeleton to control the entire layout. There are separate sections for the current day, non-current days, the current month, and non-current months. Each can have it's own look or you can run with the defaults.
For further functionality, an internal style sheet is provided to supply you the means to set a style for different types of data.
For example: Say you want 2 different sets of color-coded data (regular orders and large orders) for your shop floor calendar. You can create a calculation that will set a one-alpha field to "1" for normal orders and "2" for large orders. That calculation might be CALC1="1" if ORDTOT<10,000 else CALC1="2". We defaulted the data class to "two" (using: <td class="two">) but you can substitute the calculation instead (using: <td class="@CL001">).
Our example shop floor calendar uses this exact technique to point out large orders to the warehouse staff who would use the application.
For a more interactive calendar, specify other applications to Smartlink to. Also, if you have a lot of data in a particular day, it may skew the appearance of the calendar. If so, it might be useful to select out only the really important data using appropriate selection criteria.
Live on the Web
We have built a sample shop floor calendar on the mrc Crazy Bikes demo site using this template. See it here: http://www.crazybikes.com/employees/I00270GC.mrc.
Uses
The uses for this template are many. We use it at mrc to create a Web-based scheduling function. Now, any mrc staff member can immediately check whether trainers, consultants, and salespeople are available for assignments. Our demo site illustrates a shop floor calendar. Others have used this technique for displaying daily retail sales across different departments. You could let your customers view a calendar of shipments specifically for them in a B2B application. Let us know if you find other uses for this new template!
Get started
You can download the template, named MRCS020414, here:
http://www.mrc-productivity.com/members/software/template.html. After installing it, you'll see the new template type named "R8 (Web/CGI) Calendar Layout Inquiry." Create your application using that Web template, and you are off and running.
Brian Crowley is the Director of the Development Department at mrc.
|
|