Let's create an HTML report
that lists all scheduled tours. You need to define a batch job that
extracts the data from the database and formats it in the report
style you require.
The following illustration
shows how USoft Batch handles export tasks.
USoft Batch creates temporary
tables called external sets when exporting data. The structure of
these external sets depends on SQL statements defined to extract
the data from the database.
A second processing step
embeds the data in HTML files in the required format.
To define an external set that
extracts data from one table:
||Double-click the Definer item in the Binder.
||Choose Define, Sets, External Sets from the menu, and then type
"STEP6_ESET" in the Set Name field.
||Click the SQL Definer button next to the SQL Statement
The SQL Definer (a
specialized graphical editor for SQL statements) appears.
||On the Define Type And Name Of Statement To Build dialog, click
OK to accept the default statement type (SELECT statement).
||On the Repository tab of the catalog, expand the Scheduled
Nodes appear for each of the
columns of table SCHEDTOUR as well as for all relationships this
table is involved in.
||Drag-and-drop the Destination, Type, Start Date, Return Date,
and Capacity columns from the catalog tab onto the SQL tab page
displayed at the bottom of the SQL Definer window.
The statement on the SQL tab
should now look like the code example below.
SELECT "Scheduled Tour".DESTINATION
, "Scheduled Tour".TOUR_TYPE
, "Scheduled Tour".START_DATE
, "Scheduled Tour".RETURN_DATE
, "Scheduled Tour".MAX_PART
FROM SCHEDTOUR "Scheduled Tour"
||Click the Results tab page to get a quick overview of the data
the SQL statement retrieves from the SCHEDTOUR table.
||Choose Statement, Save to have the statement copied to the
calling USoft Batch window.
||Close the SQL Definer window, then save your work by clicking
the Save button on ribbon bar, or by choosing File, Save All from
the menu bar.
||In the External Sets window, accept the File Format and Record
Separator defaults, check the HTML Set box, then click the HTML Set
The HTML Set window
||Choose Layout Style Form from the dropdown list, and then save
||Make the External Sets definition window the active
A Special menu option
||Choose Special, Compute Elements from the menu bar.
USoft Batch now deduces the
structure of the external set on the basis of the columns that are
part of the SQL statement.
To define an export task:
||Choose Define, Tasks, Export Tasks from the menu.
||Type "STEP6_ETASK" in the Export Name field.
||Select the STEP6_ESET external set in the lookup window that
you open by clicking the External Set lookup button, and then click
||Type "ScheduledTourStep6.htm" in the Filename field, and then
save your work.
To define the batch job:
||Choose Define, Jobs from the menu.
||Type "STEP6_JOB" in the Job Name field.
||Type "STEP6_TASK" in the Task Name field.
||Type "1" in the Sequence field.
||Accept the Task, and Abort On Error default values, and type
"STEP6_ETASK" in the Export field.
You have now defined a job
with the export task as its single task.
||Click the Validate button in the top right corner of the Jobs
Running the Job and Viewing the Result