SpoolConverterPro UserGuide
SpoolConverterPro UserGuide
SpoolConverterPro UserGuide
User Guide
User Guide
Version 3.1.x
http://www.spoolfactory.com
Index
http://www.spoolfactory.com
Introduction
The distribution of information by electronic means has become something habitual and necessary. The evolution has gone from paper to electronic formats for distribution by means of electronic mail and publication on the Web. Being conscious of it, we analysed the viability of creating a tool that allowed the conversion of spool files to other formats: PDF, HTML, TXT, CSV, XML and Excel. PDF because it is a standard, HTML for Web publication, TXT is a single format, CSV for compatibility with Excel, XML because this format will have a great potential in the future, and Excel (Xml for Excel 2003) due to is a very demanded by the users. Although the market offers many PC-based solutions, the alternatives in native AS400 are really few. This motivated the development of a software component which utilized native AS400 commands to allow the conversion of spool files to different formats. Once this objective was attained, the opportunity was presented to offer something beyond the simple conversion of formats. In other words, if an AS400 document is not pleasant visually, or contains elements that make it seem old fashioned, a simple format conversion will not solve these deficiencies. For that reason, the tool was equipped with a simple system of rules that can change the appearance of a report by means of the use of colours, fonts, sizes, text transformation, text elimination, etc. This exposition caused the appearance of the tool called Spool Converter Pro. The system of rules used by Spool Converter Pro can be extended with new features. The next version of Spool Converted Pro will provide the facility to create overlays (similar to AFP utilities) in an easy, very easy, way with new graphic elements: lines, boxes, signatures, logos and color images. All this in native mode. (A Java program will be available to generate a special format of the images in a format that AS400 can understand in native mode). A practical example of the use of this tool is the case of a company that has changed its name and does not have access to program source code. By means of a text transformation rule we can easily change the old name to the new one. Another example is the requirement to modernize an existing customer invoicing document with an overlay of lines, boxes, company logo and signature of the Financial Director. This will be very easy with a single group of rules. Spool Converter Professional provides two user interfaces: a menu-driven interface, similar to IBMs WrkSplF, where spool files and conversion rules can be maintained, and a command-line interface for experienced users and programmers.
http://www.spoolfactory.com
Software Installation
Restoring Objects
Create library SPLFACTORY On the command line, type CRTLIB SPLFACTORY Create savf file SAVFSPLCVT in library SPLFACTORY On the command line, type CRTSAVF SPLFACTORY/SAVFSPLCVT Transfer the SAVFSPLCVT savf file from your PC to the iSeries library SPLFACTORY. See section at right for an explanation. Restore the objects from the savf file to the SPLFACTORY library. On the command line, type: RSTOBJ OBJ(*ALL) SAVLIB(SPLFACTORY) DEV(*SAVF) SAVF(SPLFACTORY/SAVFSPLCVT) RSTLIB(SPLFACTORY)
Useful tips
If you obtain the Acrobat Reader 110 error opening PDF files: With SPLFACPRE command fill with Y the field named There are problems with PDF If not solved, contact with SpoolFactory team. After spool conversion you can specify an user program to be called (for example, to send the file by ftp) For PDF format you have some useful and powerful features: Cover Sheet Bookmarks Windows Form Designer Countries with special alphabets (for Pdf): Contact with SpoolFactory team
http://www.spoolfactory.com
Application Preferences
Use the SPLFACPRE command to go to the screen of application preferences, where the following information is required: Key 1, Key2, Key3 and Key4 They are the keys to register the product The registry can be permanent or temporary The registry keys remove the advertising warning when the conversion rules are used The PDF, HTML and TXT generation can works in Shareware mode. In Shareware mode there is a limitation to process spooled files with a maximum of 100 pages, and an advertising warning appears in the reports Language There are two languages available: English and Spanish *NOMAX Option By default, with Y value. It indicates if is allowed to create files without limits of size and number of members There are problems with PDF Valid values: Y and N In some countries there are problems opening the generated PDF with Acrobat Reader. If it happens, you can test filling this field to Y and trying again the PDF generation If previous doesnt work, fill the field with N and try the next Execute SPLFACPRE command Press F10 to access to special characters screen Press F10 to generate a spooled file for testing With this spooled file, convert it to TXT (using Spool Converter software) and transfer it to PC Open the file with a text editor, and find the lines where are located the next two characters [ (Open Bracket). We need the 3 digits number at left of the line (In advance, first number) ] (Close Bracket). We need the 3 digits number at left of the line (In advance, second number) Execute again SPLFACPRE command, and F10 to access to special characters screen, and at left table you must store these numbers in the first fields, which corresponds with Open Bracket and Closed Bracket When done, generate a PDF again. The problem would must be solved CSV Separator Allows to specify the field separator for CSV files depending of our configuration Valid values: , and ; XML Encoding Value for XML files, for example, ISO-8859-1
http://www.spoolfactory.com
SPLFACPRE Command
http://www.spoolfactory.com
Command Mode
This mode uses the commands to convert spool files to the following document formats: PDF, HTML, TXT, CSV, XML and Excel (Xml for Excel 2003). In order to use the Command Mode, the user should be familiar with basic spool operations concepts. Otherwise we recommend the use of the Spool Manager menu interface described in the next section. With these commands, you can include the conversion process in the CL programs that generate the reports, or you can create new CLs that automates the conversion process. The required data are similar to the used ones by the system command CPYSPLF (Copy Spool File), and that identify the spool file to convert. You can place the converted report in a traditional iSeries file, or in the IFS. If you want to place the converted report in a traditional iSeries file, you must fill the next fields: file name, library and member. If the file already exists, it must have a record length of 500. If the file does not exist, it will be created in run time. If you want to place the converted report in the IFS, you must fill the next fields: the file name without extension, and the path. For example: IFS File: IFS Path: (Also it is valid myfile /home/ /home
This will give like result (if PDF format is selected) /home/myfile.pdf If you specify an extension file, for example myfile.pdf the final result will be myfile.pdf.pdf An interesting option is the possibility of calling to a user program to make some actions with the generated file. This user program will receive 13 parameters: Name of AS400 file (10 characters) Library (10 characters) Member (10 characters) Name of IFS file (30 characters) Path of IFS file (30 characters) Path & Name of IFS file (100 characters) Format (10 characters) Possible values: PDF, HTM, TXT, CSV, XML, EXC Spool File (10 characters) Spool Job Name (10 characters) Spool User (10 characters) Spool Job Number (6 characters) Spool Number (6 characters) User data (200 characters) A possible utility for this system of control would consist, for example, in sending the resulting file to a FTP server. There is a parameter, Character of end of line. This parameter will be used in the future. It only allows the *CRLF value.
http://www.spoolfactory.com
With the parameters seen so far, the generated file will be a simple format conversion. But the real power of the tool resides in transforming the colour, type style, font and wording of the report by means of simple search and replace rules. These individual 'search and replace' rules are then grouped together into "Rule Groups" that are applied to the spool file during the conversion process. The creation of rules and groups is explained in the section titled "Menu Mode (Spool Manager)". The commands allow the user to indicate the name of the rule group which should be applied to the spool file during transformation. It also allows the user to indicate the format of the transformed file: PDF, HTML, TXT, CSV or XML. Next is the list of available commands, depending on the format to generate: SPLFACTORY/SPLPDFPRO Spool to PDF (*See note) SPLFACTORY/SPLHTMPRO Spool to HTML SPLFACTORY/SPLTXTPRO Spool to TXT SPLFACTORY/SPLCSVPRO Spool to CSV SPLFACTORY/SPLXMLPRO Spool to XML SPLFACTORY/SPLEXCPRO Spool to Excel (Xml for Excel 2003)
http://www.spoolfactory.com
http://www.spoolfactory.com
http://www.spoolfactory.com
On the upper portion of the screen appear the actions that we can perform with the spool files: Option 5: Display the Spool File Option P: Generate PDF format Option H: Generate HTML format Option T: Generate TXT format Option C: Generate CSV format Option X: Generate XML format Option E: Generate Excel format (Xml for Excel 2003) Option 1: To select spool file for tests
http://www.spoolfactory.com
When one of the formats is selected, it appears a screen with the options to generate the report. After calling to the converter, a message is displayed with the result of the conversion.
http://www.spoolfactory.com
http://www.spoolfactory.com
http://www.spoolfactory.com
http://www.spoolfactory.com
Font size (Default is 12) Font color. At the moment, the available colors are: - Black (Default), Red, Green, Blue, White, Yelow, Silver, Gray, Maroon, Purple, Pink, Dark Green, Caqui, Navy, Turquesa, Azul Claro The possibility exists of applying special effect to the text Stroke Filled of color
http://www.spoolfactory.com
http://www.spoolfactory.com
http://www.spoolfactory.com
http://www.spoolfactory.com
Rule: Lowercase
With this action (for PDF, HTM and TXT format) we can change the text of a string or an entire line from upper case to lower case. First, specify a text string that will positively identify the line to be processed. Next, specify the beginning and ending positions of the text string specified above. Finally, indicate whether the processing will apply only to that string or to the entire line. The initial capital letter of each word is always respected. For example, if we have the following line of text when applying the rule would be SOFTWARE COMPANY Software Company
http://www.spoolfactory.com
http://www.spoolfactory.com
http://www.spoolfactory.com
http://www.spoolfactory.com
http://www.spoolfactory.com
http://www.spoolfactory.com
http://www.spoolfactory.com
An interesting application of this rule, is with field Apply every, and represents every how many lines we want to apply the rule. By default the value is 0, and it is applied to all the lines which have the localization condition. But if we fill other value, for example 1, it will be applied in an alternate way, in our example every 1 line. With this option, we can get the Green Bar Reports.
http://www.spoolfactory.com
http://www.spoolfactory.com
http://www.spoolfactory.com
Rule: Bookmarks
This rule allows to generate bookmarks. Bookmarks are very useful to navigate in large reports. It is possible to generate bookmarks in two possible ways. By page number: the only needed information is the text will appear before the page number Examples: Page, Page Number, etc By content of a variable located in the report The variable is located specifying line, column, and length When the value of this variable changes, then a bookmark entry is created For example, if we have a report of sales classified by countries, and the value of the country is in the header of each page, then we can create an index with the values of the countries. When the user click in a country, then will appear located the page of the selected country
In next example, has been applied an easy rule to create an index using bookmarks. The original report is the result of a Query obtained from a file with a list of objects. The report is classified by object type, performing a new page when changes the value. In this case, has been specified we can to create the bookmarks with the value contained at the line (row) and column where this data is located, specifying too the length of the data. In the case of the first page, which contains the title of the report, no value exists in the specified positions. By this, a default value is used: TOP.
http://www.spoolfactory.com
http://www.spoolfactory.com
http://www.spoolfactory.com
Rule: Annotation
With this rule we can insert an annotation, a little box containing a text. We can decide if the annotation can appear in all the pages (by default), in the first or in the last page. When we click in the annotation, the text of the annotation appears in the document.
http://www.spoolfactory.com
http://www.spoolfactory.com
User Preferences
The "User Preferences" screen will record common default values for many Spool Converter Pro operations. In the file names a fixed name can be given that will be applied to all the generated information, reason why they will be overwritten, or to give the option * NAME that will give to the report the name of the file of Spool. For example, with option * NAME, the file of Spool QSYSPRT it would be possible to be identified in the integrated system of archives IFS like /home/QSYSPRT.PDF The End of Line Characters parameter is reserved for future uses. At the moment, the only valid value is *CRTLF. The program can be identified to call after generating the report. This program will receive five parameters, the name of the file, the library and the member of generated AS400 file, name of the IFS file and path of the IFS file. We can specify the group of rules to apply by default. The date format is used at the time of showing the list of spool files in which it appears the date of creation. The field Format for Testing is for specifying the format to generate when we generate a conversion in design mode. And with the PF10 function key, we can select the spool file for working in design mode.
http://www.spoolfactory.com
Considerations when generating the rules Changes of text format and content
When a spool file is converted, the execution of one rule can affect the way in which the next rule operates. For example, if we have the line LIST OF OPERATIONS We locate the LIST word and we apply the lowercase rule. We will obtain List Of Operations If we want to apply a new rule with this line again, and we use the same word to locate the line, we cannot try to locate the LIST word since it will not find it. It will be necessary to locate the List word. For that reason it is important to consider the order in which the rules will be executed, remembering that if we do not an order to the rules, they will be executed according to the internal numeration assigned when creating them. If some rules in a rule group are ordered and others are blank, the rules with no order will be executed first. Also, if in the previous case we changed the LIST string by the string ABCD, the next rules that affect this line will have to make the location with the chain ABCD or with another different chain in other positions that allow us to identify the line. A similar case happens if we located LIST in the positions from the 11 to the 14, and we applied a displacement (move line rule) of 2 positions to the left from position 11. The following search of the LIST text it would have to be of positions 9 to the 12.
An aspect important to consider, is that when changes of formats are applied to a part of the text of the line, and not to the complete line, internally the application uses a complex system of text segmentation that later does not allow to apply changes to the complete line. For example, if we display the spool file Display Spooled File File . . . . . : QPRINT Control . . . . . Find . . . . . . *...+....1....+....2....+....3....+....4....+....5 FIRST LINE OF TEXT We applied one rule (change format) that locating the line where it is the word FIRST puts to positions 7 to the 11 (word FIRST) the format of red color. If later we do the same location, indicating that we want to apply to all the line the green color, the combined result of the two rules, executing itself in the order that we have commented, will be the following one FIRST LINE OF TEXT
http://www.spoolfactory.com
If we use Times font, the result would be Name Surname George Robinson 8871234-J Peter Grant 8888912-L Identification
If in a point of the report we do a change of format applying a size of very great letter, the rest of the report based on the applied change will not be fit, reason why we can invade the text placed in the superior part. The big fonts can be applied to texts well that have blanks spaces in the superior lines.
Message File
At the moment, in the generation of the message two possible codes of the file of messages SPLFACMSGF are returned, with a descriptive text of the result of the operation. The codes are: SPL0000 SPL0001 When operation has finished correctly When any error happens during the process
In the future, a different code will be generated for each different possible result, in order to automate the error management.
http://www.spoolfactory.com
Examples
If we have a spool in which the lines of head are of the style: (The first line identifies the reference positions in the record) 1xxx5xxxx10xxx15xxx20xxx25xxx30xxx35xxx40xxx45xxx50xxx55xxx60 NAME CUSTOMER NUMBER ADDRESS AMOUNT
We can indicate that when in position 6 until position 9 find the text NAME, changes the color of all the line blue NAME CUSTOMER NUMBER ADDRESS AMOUNT
Also we can cause that the font is Courier Bold Italic NAME CUSTOMER NUMBER ADDRESS AMOUNT
In positions 24 to 40 we will cause that it appears City NAME CUSTOMER NUMBER City AMOUNT
Finally we can apply to this line the lowercase rule Name Customer Number City Amount
Also if we have a title like the following one LIST OF CUSTOMERS ================= We can leave it of the following way
List of Customers
Applying a change text rule, a format rule and a delete line rule (the line with = characters)
http://www.spoolfactory.com
The part of lines of detail of a report must have some differentiating element that identifies them. In the next example it could be the comma decimal of Amount in position 56. 1xxx5xxxx10xxx15xxx20xxx25xxx30xxx35xxx40xxx45xxx50xxx55xxx60 NAME CUSTOMER John Smith NUMBER 22341234 ADDRESS London AMOUNT 1,000.21
Once identified the type line of detail, we could apply new rules, being for example: Name Customer John Smith Number 22341234 City London Amount 1,000.21
All the information do not count on elements identifiers in the lines of detail, reason why next more complex generic rules will be implemented as it can be the identification of alphabetical or numerical strings in determined positions. By now, there are two experimental values, that you can specify to find a lines: *NUMERIC It finds numerical values in the specified positions It works to identify only numerical characters For example, from positions 1 to 5, we can find a *NUMERIC value 19283 valid *NUMERIC 1.123 NOT valid *NUMERIC *NUMEDIT It finds numerical edited values in the specified positions It works to identify only numerical edited characters For example, from positions 1 to 5, we can find a *NUMEDIT value 12345 valid *NUMEDIT 1,345 valid *NUMEDIT 1, .5 valid *NUMEDIT It finds values containing blank spaces in the specified positions The header and footer rules do not need to locate strings of text.
*BLANKS
http://www.spoolfactory.com
Next are two examples of a report generated by means of a Query procedure. The details see with more clearness, opening the archives pdf that are enclosed with Acrobat Reader. The first example of report pdf is generated with the standard version, and the second with the professional version.
http://www.spoolfactory.com
Next are two examples with the professional version. The second example, that is most complex, has 36 of transformation rules. Of those rules, 11 has been used to change thousand point and decimal comma of the American format to the Spanish.
http://www.spoolfactory.com
Here are two examples more of the print of the source code of a program, generated with the two versions. For the second example 6 rules of transformation have been used.
http://www.spoolfactory.com
Images Catalogue
Images are stored in a physical file of AS400. Previously it is necessary transform the image in an understandable format for AS400. With application is included a little Java utility to execute in PC, that allows, from a image in gif format, generate a text file that contains the information of the image, in order to upload it to AS400 (for example, with Ftp) to incorporate the image to the images catalogue. It is distributed the Zip file AS400GifConverter. It is necessary to decompress it in C: unit, in root directory, with the original folders specified in Zip file.
http://www.spoolfactory.com
When it is decompressed, we will obtain the AS400GifConverter directory which contains a sub-directory named gifconverter with the Java classes and an executable named gifconverter.bat. This bat file launch the visual application to convert the Gif format. Executing gifconverter.bat
http://www.spoolfactory.com
In the bottom windows, it is given the image resolution, the name of the generated file, and the size in chars of the generated text file. The generated file will named with the name of the image in AS400, follows of _RGB and with extension TXT. In our example LOGODEMO_RGB.TXT If image name in AS400 is not specified, by default will given NONAME, and the result file will be NONAME_RGB.TXT The bottom window remember us too the steps to do to incorporate the image to the AS400 images catalogue. Next, these steps will be described. When we have the file text with the information of the image, we must upload it to AS400 (for example with Ftp), and put it in the AS400 file SPFPIMGAUX in SPLFACTORY library. Next we will execute in AS400 the SPLFACIMG command in SPLFACTORY library. A list of available images will appear. With F6 key we will indicate that we want add a new image. The process will detect if there is an available image to load, giving the image name, and asking us confirmation to add to the catalogue. If image exists, the new image will replace to the existing image. At next pages are shown some screens.
http://www.spoolfactory.com
http://www.spoolfactory.com
http://www.spoolfactory.com
An interesting feature is that we can modify in AS400 the image properties (Option 2=Change). We can modify the RGB components of the image, or dark or light the image. If we dont like the result, we can load again the original image in the catalog ue. The information of the image must be in file SPFPIMGAUX.
At next page are showed some examples obtained with this functionality. Original Image
http://www.spoolfactory.com
References
http://www.spoolfactory.com