|
|
Difference between 'Spool To'
and 'Output To'
|
|
Article
No |
Q0002 |
|
Version Applicability |
PERKS
2.45
and later |
|
Last Reviewed On |
May
02, 2000 |
SCENARIO : I wanted
the data, as available in a Report, to view in a Spreadsheet Package, say, Microsoft
Excel. I know that when I extract a Report in a spooled form, the Spool file
created is an ASCII file (text file). So, after spooling, I specified the relevant details
for importing data from the text file. However, upon importing the data, I observe that a
few gibberish characters have been imported. As I am sure that there is no problem with
the installation of MS Excel on my machine, I would like to know how to get rid of this
problem. As such, the Spool module is working perfectly in the sense that when I send the
Spool file to a printer from the command prompt. For example,
using a command like: "TYPE filename > LPT1", I get perfect prints. No
garbage is shown in the printout. But, the problem happens whenever I have
tried to view the data in certain application, like a text editor or a Spreadsheet
Package.
EXPLANATION :
Reasons could be manifold why you may want to export
processed data from within PERKS to some external System. This article, by way providing
extended assistance, discusses on viewing data once it is outside the realm of PERKS.
The native format of data, as held within PERKS, is
"DBF" format. The System offers options to export data into formats, like CSV
(Comma/Character Separated Value), Text, or SDF format. Most applications provide options
to import data at least in Text format. Hence, you might decide to export data from PERKS
into Text format and import it into some other application.
In addition to taking output to text file (say, of the
Detail Segment), the System also permits redirecting the entire Report, as
visible on the screen, with all its layout properties, into a file on the disk. This file
can be later printed simply from the command prompt of the Operating System.
Nevertheless, we should note that,
spooling data (onto the hard disk) is not absolutely simultaneous to taking the output of
a specific segment of a Report in text format. Instead of feeding it to the Printer, if
you attempt to view spooled data directly through a text editor software, or
try to import this spooled data directly into some other software, which expects data
strictly in text format, you might run into problem. It happens because this is not the
suggested use of the feature.
Suppose we create a design of a Pay-slip Report
containing the fields (columns) Employee Id, Name, two HOPs
(Basic and Transport Allowance), with column headings being placed
in Page Header, Page Number and Running Total for a column (Basic) in Page Footer and
Print Date in Report Footer. Underneath is a representation of the Report
exported as (A) a text file and (B) spooled to a file:
-
Text File
|
1 |
Erik Schultz
|
3000.00
|
1590.000000
|
|
2 |
Baseer Ahmed
|
3500.00
|
1855.000000
|
|
3 |
Ashoke Singh
|
3200.15
|
1696.079500
|
-
Spool File
|
Page No: 1 |
|
Employee ID |
Name |
Basic |
Transport
Allowance |
|
1 |
Erik Schultz |
3000.00 |
1590.000000 |
|
2 |
Baseer Ahmed |
3500.00 |
1855.000000 |
|
3 |
Ashoke Singh |
3200.15 |
1696.079500 |
|
Page Total |
|
9700.15 |
|
|
|
|
Page No 1 |
|
Report Total |
|
9700.15 |
|
|
|
Print Date: |
28/04/2000 |
The differences are
obvious. If the output is taken to a spool file, the entire report with all
its layout properties (including the page feed character at end of a page) is available
for print. If the Report is exported as a text file, it is performed in context of the
data in particular segment (typically, the data segment). It is ideal for import of data
into another software.
RESOLUTION :
If you are exporting data from PERKS, to
be read by some other software (i.e., not alone for printing purpose) we suggest you, not
to read from, or import, spooled data directly. Rather, you can do one of the following:
-
Export the data directly into a chosen format, supported
by that software. For example, in order to export to the text format, different interfaces
provide different export options like Output to SDF format or Copy
to SDF format or Output To File (i.e., choosing Output To
ASCII format). You can also export data using the Output To CSV format.
In fact, this format is quite popular amongst several Spreadsheet Packages.
-
If, for some reason, you have no other option left but to
use the spooled data file for use with some software, you can try this. Open the data file with a text editor (like MS-DOS
Edit etc.). Find all the end-of-page (viz., the form-feed / FF character;
ASCII value: 12) characters and replace each of them with a normal carriage-return. Thus,
instead of feeding a new page, we feed a new line only.
Evidently, this article discusses about
the distinction between the two data export options, viz., taking output to text format
and spooling data. We spool a Report for the purpose of printing (typically
through a dot-matrix printer) only. If we need to view data through some external
application, such as a Spreadsheet Package, we should export the data in any format, which
that Package can interpret. In general, Text format is supported by almost all
applications, though the other available formats are also quite popular.
MORE INFORMATION :
Hitherto, the Windows platform does not
support direct spooling. In a cross-platform environment, you can spool a
Report, and then, directly take a printout of the Report from a Printer attached to, for
example, a Unix machine (using the lpr command from the Shell).
Desirably, the System expects only the
data fields in the Detail segment of a design that you need to take output to
text (or, a .DBF file etc.). Text fields, like column headers, should not be inserted into
the detail segment.
|
|