Application Reports (Magic xpa 4.x)
You can provide application reports using various display and printing capabilities.
The most common requirement of a business application is to provide output of processed data, that is reports. Normally you create a batch task that processes the data. In this section we will examine the various ways by which the output of such batch tasks can be defined and transmitted back to the browser.
You can easily call a batch task that runs the report logic and produces the report output simply by issuing a Call Program operation for the browser task. The batch task can transmit its output back to the end-user by sending the output to the requester I/O device. See also Calling a Batch Task.
Any output of Merge forms to Requester I/O devices is transmitted back to the client as soon as the immediate batch task completes its run. As the browser client receives the HTML output, a new window is opened to display the returned HTML data.
You can create or handle any file that can be viewed by the client and have it displayed back on the client as a result of the called batch task. You should keep or create the file in a directory that is accessible using the web server, that is a virtual directory. The result of the batch task should be an HTML page that provides a link back to the file. You can provide the link as a hyperlink on the HTML page that the end-user clicks to open the file. Another way to point the end-user to the file is to set the page to automatically refresh its content by issuing the file URL.
Tip:
|
To automatically refresh the content on an HTML page to point to another URL, you should place a META tag in the HTML header to refresh the page content:
<META HTTP-EQUIV=Refresh CONTENT="0;
URL=myresult.pdf">
|
You can design your report batch task to produce an HTML result, using a Merge output. The output of these HTML-based interface form types should be directed to a Requester I/O device.
The easiest way to create a report is to use Magic xpa’s graphical printing capabilities. You can simply create a batch task that outputs GUI forms to a graphical printer I/O device.
Transmitting the Graphical Printing Back to the End User
In most cases you would want to provide the end user with an output preview and let the end user print the output or parts of it. To serve this end the graphical I/O device should point to a PDF printer driver that produces a PDF file. The PDF file should be placed in a directory that is visible to the web server. After that you should output an HTML file back to the browser client that redirects the browser to the result file.
Server-side Printing
In an Intranet application, where the organization’s printers are available to the enterprise server, you can choose to have the batch file output the graphical forms directly to a defined printer on the network.
Browser-Client Display
Sometimes you might want to provide the end user with the ability to simply view the result data without printing it. In that case, you can design your report as a browser task that displays the result data. This task lets you provide the end-user with an easy scrollable view of the data.
|
This option is suited for result data of a large number of records. Instead of processing the entire result data view, the end user can easily view the result data page by page.
|