APEX

Following is documentation on A-Shell's print preview and export-to-Excel subsystem.

Introduction

A-Shell Preview and EXport ("APEX") is a built-in component of A-Shell for Windows and ATE. At the user’s option or under program control, APEX receives a print file and re-directs it into a preview window. That window displays an image of the report and provides the user with various viewing options (zoom, multiple pages, single page, etc.). After previewing the report, the user may then print the report as it was originally intended to be printed (i.e., to the originally-specified printer), print it under user control (different printer, say, or landscape instead of portrait), or discard it. The purpose of the viewer, as with all such print preview functions, is to make sure that you are printing what you think you are printing—and to save time, energy, money and paper in the process. In some cases, viewing the report may eliminate the need for printing entirely.

APEX offers a variety of controls and options to facilitate viewing the report. Most of these items, and how to use them, are fairly obvious.

APEX also includes a valuable Export to Excel function, which is initiated by a button on the toolbar.

Following are some screen shots illustrating various aspects of APEX.

Title Bar and Tool Bar

The APEX title bar displays information about the report: original filename ("tstz" in this example), the first (-1) printing this session, temporary extension (.APF for "A-Shell print file"), the number of pages in the report, and Windows printer for which this report is intended, and the printer properties being used for printing. The toolbar provides options (in order from left) to set zoom percentage (10% to 999%); zoom in; zoom out; single page; multi-page grid (drop-down menu); page number / back / forward; print setup; print; help; close; print per application; find text (search); open another report; APEX preferences; export to Excel; export preferences.

 

Multi-Page Grid

Clicking on the multi-page grid option (see toolbar above) offers choices for the layout of multiple pages. You can (barely) see the grid choices below near the top left. The full screen shows the report in the 4 (across) by 2 (down) grid.

 

Find Text (Search)

Clicking the find text tool and entering a word into the "Find" dialog box ("exitcode" in this case) causes all the occurrences of "exitcode" on the current (first, in this case) page to be highlighted. Clicking "Find Next" displays the highlighted words on the next applicable page, etc.

 

Licensing

The programs and files needed by APEX are automatically installed on the PC with the underlying software (A-Shell for Windows or ATE). Starting from the date it is installed, APEX will work in unrestricted mode for approximately 30 days. After that free-trial period, APEX reverts to demo mode, which means that it will work so you can see its functionality, but with qualifications. When operating in demo mode, APEX will display an annoying message saying that it is in demo mode.

To enable full APEX operation on your PC, you will need to obtain an APEX software license from either your application provider/dealer or from MicroSabio.

Preferences

Several things about how the preview function behaves are under user control, and these things are set on the Preferences dialog. This dialog is accessible from both the menu bar in A-Shell/ATE (Settings | Preview Preferences) and from the Preferences button on the preview toolbar. The following screen shot, while not necessarily identical to the one shown in your version of the program, illustrates some of the user-controlled options.xe "Discard"

 

Preferences toolbar button: 

 

 

Preview on Print

Normal report printing consists of a report being created by a program, and then being sent to the PC for printing. The "Preview On Print" option allows you, the user, to control the circumstances under which those reports from the host, received for printing, are instead displayed on your screen. The "Always" and "Never" options should be fairly clear. The two "Application Control" options allow you to let the program that created the report determine whether the report is previewed--and gives you the option to say what happens when the report program doesn't specify anything.

There is no right or wrong, or best or worst, setting for this option. It is strictly determined by (a) your needs and objectives, and (b) those of your work environment.

The default value for this setting is "Application Control, Default=Off", which means that (a) APEX is expecting to receive a launch or don't launch command from the program that generated the report, and (b) if it does not get such a command, it will NOT launch.

On Exit from Preview

What do you want to happen when you exit the preview window (which, by the way, you can do by clicking on the "X" in the top right corner of the preview window, or by hitting the Escape key)? As you make your choice, keep in mind that all reports viewed with APEX are saved to disk; you can come back and view them again later if you wish.

Preview Window State

It is not possible for the program that launched the preview, or the programmer who wrote the program, to know how the user wants to deal with the preview: display the preview windows right now, or continue working and view the report later? The Preview Window State allows the user to set her preference for what happens when a report is sent to the preview window. "Visible (Foreground)" means that the preview window is shown right now. "Minimized (Background)" means that the preview window is created right now but then minimized; it appears in the task bar, which you need to click in order to view the report.

Preview File Retention

When a file is viewed using APEX, it is possible that the user may want to view this file again later. So as soon as a report is viewed, a copy of it is written to a file in the APEX folder. If the original file name being viewed is "report.xxx," then the file that is written into the APEX folder is called "report.apf" (apf = A-Shell Print File). These files remain in the APEX folder, and can be opened by the Open another report file button on the toolbar.

How long do they remain in the APEX folder? This is controlled by a setting on the Preferences called "Preview File Retention (hours)." The default value is 96 hours, 4 days, but you can set it to whatever you wish.

From an environmental perspective, the fact that you can view the report again later should make it easier to forego actual printing of every document (after previewing), merely out of fear that you might need it reference it in a few hours or days. The default setting of 96 insures that your disk won't get clogged up with more than four days worth of report files.

Files Requiring Preprocessing

Files that require processing before they can be displayed include GDI print files (i.e., those contain graphical printing commands), files printed through ATE, and any files using the PREFIX or SUFFIX options.

 

Possible options: "Close all previews on exit?"

 

Option: Delete report files after we're done with them? (or let them sit)

 

Ctrl +/- zoom increment %

 

Export to Excel: save to disk?

 

 

 

Keystrokes and Mouse Clicks

Keystroke

Action

 

Multi-page Mode

Home

Positions to the first group of pages, starting at the first page. The first page becomes the current page. testing.

End

Positions to the last group of pages, ending at the last page. The first page of the displayed pages becomes the current page.

Control+Home

Same as the Home key.

Control+End

Same as the End key.

Left Arrow

Moves to the previous page. The displayed group of pages is adjusted if necessary.

Right Arrow

Advances to the next page. The displayed group of pages is adjusted if necessary.

Up Arrow

Moves the first page of the displayed group of pages to the previous page (or sheet in duplex mode). The current page is adjusted if necessary.

Down Arrow

Advances the first page of the displayed group of pages to the next page (or sheet in duplex mode). The current page is adjusted if necessary.

PgUp

Displays the previous group of pages. The current page is adjusted if necessary.

PgDn

Displays the next group of pages. The current page is adjusted if necessary.

Plus on NP

Zoom in. ("NP" refers to the numeric keypad.)

Left Click

Display page clicked in single-page view at scaling of last single-page view.

1 (numeric)

Switches from multi-page mode to single page mode.

 

Single Page Mode

Home

Positions to the top of the current page.

End

Positions to the end of the current page.

Control+Home

Positions to the top of the first page.

Control+End

Positions to the end of the last page.

Left Arrow

Horizontally scrolls left on the current page.

Right Arrow

Horizontally scrolls right on the current page.

Up Arrow

Vertically scrolls up on the current page.

Down Arrow

Vertically scrolls down on the current page.

PgUp

Vertically scrolls up on the current page. At the top of the current page, move to the bottom of the previous page.

PgDn

Vertically scrolls down on the current page. At the end of the current page, advance to the top of the next page.

Plus on NP

Zooms in . ("NP" refers to the numeric keypad.)

Minus on NP

Zooms out. ("NP" refers to the numeric keypad.)

Escape

Close

Left click

Zoom in. Same as "plus zoom" button.

Right click

Zoom out. Same as "minus zoom" button.

Ctrl+PlusKey

Zooms in 5%.

Ctrl+MinuKey

Zooms out 5%.

2 (numeric)

Switches from single page mode to multi-page mode.

 

Both Modes

Escape

Close

Ctrl+P

Print

Alt+Ctrl+P

Toggles between main window (A-Shell or ATE) and Preview.

Ctrl+Enter

Toggles between multi-page and single page modes.

Ctrl+Alt+

Toggles between maximized and normal windows.

Ctrl+G

Go to page number control.

Ctrl+Z

Go to zoom control.

F1

Help

F3

Find

Operations

Zoom Percentage and Zoom In/Out

The Zoom Percentage control shows various steps of zoom. When you use the magnifying glass buttons to zoom in or zoom out, the steps by which you zoom are those shown in the zoom percentage control. You may manually set (by typing it in) the zoom percentage to any value between 10 and 1000. Note that when you are selecting a value for the zoom percentage control, and it has the focus, using the PageUp and Down key, as well as the up and down arrows, apply to the zoom percentage and not to the report being displayed. In other words, you can cycle through the zoom percentages by using those directional keys.

Find Text

This button on the toolbar will be grayed out (inactive) if the report being previewed does not contain any text—i.e., is all images and/or graphics. To initiate a text search, click on this button and enter the text to be found in the resulting dialog box.

 

Export to Excel

APEX includes an Export to Excel function which is initiated via a button of that name on the toolbar. There is also a button for setting the export preferences.

 

Print As Application Intended

This is rather an odd function to see in a Windows program, so a bit of explanation is in order.

Reports that are generated by A-Shell programs frequently are sent—by the report program—directly to a PC printer. In addition to the report, those print instructions include information for the printer, such as the name of the printer, number of copies, etc. However, APEX intercepts the report and (a) stops it from going directly to the printer, and (b) allows the user to now print the report using different parameters than the report program specified. Which is fine, and of course the user can print as he/she wishes.

But she might decide what she really wants, after looking at the report, is for it to be printed how the report program originally intended. Unfortunately she doesn't know what the report program intended; perhaps it was going to print six copies on a network printer called "Laser45."

By using this oddly-named button and function, the user can make sure that the report is handled and/or processed and/or printed as the original instructions intended.

If you do not need this function, just use the regular print operation.

 

Open another report file

See Preview File Retention in this document for information on what files may be opened and how they got here.

When you click this button, you will see a standard Windows file open dialog. Unfortunately, the list of file names that you see is probably not enough information to figure out what report it is you want to see. On the file open toolbar, you should see an icon near the top of the dialog box called Views, and one of its options is "details." If you click on the details icon, you should be able to see a little more information about the files. You may click on the column headers to sort by those columns in any effort to fine the report you're looking for. Unfortunately, not much information is available to you here, so you'll just have to open as many reports as it takes to find the one you're after.

Other Topics

Custom Extensions

You can add your own extensions to APEX, which are accessed as buttons on the toolbar and which call your own BASIC code, by defining them in the APEX configuration file, ASHCFG:APEX.CFG. The configuration file, if present, is scanned for commands of the following form:

BUTTON=prog, iconspec, tooltip {,msgno, inifile}

prog

indicates the subroutine which implements the extension. In theory it wouldn't have to be an SBX, but currently that is the only format supported, so prog must be in the form of "SBX:name", e.g. "SBX:PRTXLS". The corresponding subroutine (e.g. PRTXLS.SBX) must be in the BAS: directory (e.g. c:\ate\dsk0\007006\prtxls.sbx). The subroutine should be written according to the same interface specifications used by the printer initialization command line, COMMAND=SBX:... (see A-Shell Setup Guide).

iconspec

specifies the icon to display in the button that will be added to the toolbar. Supports the same syntax as for AUI_CONTROL icon buttons (see the A-Shell XCALL Reference).

tooltip

is a short tooltip to display when the mouse hovers over the button.

msgno (optional)

may specify a message number in the file <inifile.lng>, where lng is the current language extension, e.g. USA, to supply the tooltip text. If present, it overrides the tooltip parameter above.

inifile (optional)

may specify an initialization file used by the extension, although the details of how is is used are up to the custom code in prog.

The file may also contain any number of comment lines, each beginning with a semicolon in the first position. Here's , for example:

;APEX customization

;BUTTON=prog,icon,tip{,msgno,ini}

;If msgno>0, is expected to be msg 002,### in inifile.lng

BUTTON=SBX:PRTXLS,ashico1::document_out,Export to Excel,38,BAS:PRTXLS.INI

BUTTON=SBX:PXLCFG,ashico1::preferences,Configuration Options For Export,0,BAS:PRTXLS.INI

There are no particular limitations on what the subroutine (prog) may do, other than that it cannot delete or replace the file being previewed, and must eventually return so that APEX can resume control.

 

Debugging

In case of a problem launching the preview from ATE, use the debug message window to help clarify what is happening. Call up the A-Shell GUI Control Operations dialog with control+shift+double-right-click, then select Show Debug Dialog. When the debugging/trace window comes up, repeat the print attempt. It will log the command string that is actually being used, which might then be helpful to test independently, such as from Start..Run, or at least useful in identifying the problem.

Settings

In ATE, changes to Preferences are immediately stored with the connection profile in the Windows Registry. This means that they are both implemented immediately, and saved for future use; all subsequent operations of the preview window, whether in this session or new sessions, will reflect the latest settings.

In A-Shell/Windows, changes to Preferences are part of the overall A-Shell settings set which, along with the other options on the various Settings menu dialogs, are stored in the A-Shell settings (.ash) file. However, as with all other settings, changes made in the dialogs are not automatically written to the file. Thus, they only affect the current session. To make them permanent, you must save them via the File | Save option.

Files and Folders

The help file is called "apex.chm."

When you call up the Preferences menu, the actual words you see are taken from the file SYS:SBRMSG.USA. If you see odd codes in place of intelligible options, then your SBRMSG file is not being found.

Any temporary work files required by APEX are also created in the APEX folder.

The default location of the APEX folder is c:\apex, and this folder will be created the first time it is needed. If you don't like this folder and/or want it to be placed somewhere else, you may create an environment variable called "APEX" and point it wherever you wish.

Most of the print preview and display-related aspects of APEX are performed by a program module called "SftPrintPreview_###.dll" where "###" is platform and version information. This file lives in the main A-Shell or ATE folder on your PC.

Most of the export-to-Excel functionality is contained in the subroutine "prtxls.sbr." This file is found in DSK0:[7,6] of the A-Shell or ATE file system.

 

PRTXLS.INI Export Init File

Various operations and options in the export-to-Excel process are controlled by settings in the export initialization file, PRTXLS.INI. If this file is missing or an individual lines/statement is missing, APEX will use the value shown as "Default" in the table below. The init file is normally stored in the [7,6] directory or equivalent, although when PRTXLS.SBX is invoked from the COMMAND statement of a printer init file, the init file specification may be passed as an argument (e.g. COMMAND=SBX:PRTXLS,dsk7:xls123.ini[40,30]).

Note that each of the statements below must reside within the section indicated. Within a section, the order or presence/absence of a given statement is not relevant. The section names are in upper case, are enclosed in square brackets, and are preceded by a blank line. See the sample init file section.

As with many init files, lines beginning with semi-colons are comments and are ignored by the file processor. Comments can only occur on their own lines--i.e., cannot be appended to the ends of command lines.

Statement

Section

Values

Default

Description

IncludeTotals

DATA

0,1

0

If set, lines which look like totals or subtotals are treated as data lines.

IncludeBlankLines

REMNANTS

0,1

0

If set, blank lines are included in Remnants worksheet.

IncludeDupLines

REMNANTS

0,1

1

If set, duplicate lines are included in Remnants worksheet. (Otherwise only one line per set of duplicates is included.) For example, if set, the Remnants page may have many identical lines containing column headers.)

SortBy

REMNANTS

0,1

0

If set, Remnants lines are sorted by their contents.

BGcolor

ORIG

See sample init file

Silver

Background color of "Original" worksheet.

AppendSeqNo

POST

0,1

1

If set, a sequence number is appended to the XLS filename to make it unique.

SaveToDir

POST

Path specification

 

Directory where the XLS file is saved.

SendToPC

POST

0,1

1

(UNIX only) If set, causes the exported XLS file to be transferred to the PC using ATE/ZTERM FTP protocol.

Launch

POST

0,1

1

If set, the spreadsheet program (typically Excel) is launched to view the spreadsheet.

RemoteServer

POST

IP address: port

n/a

Specifies the location of a service to generate the XLS file. (Local generation requires that Perl be available and the WriteExcel add-on library be installed.)

IgnoreLocalServer

POST

0,1

0

Set to force use of RemoteServer even if local generation is available.

ServerErrorURL

MISC

URL

 

URL of page to display when an error related to the RemoteServer occurs.

 

Sample Init File

;PRTXLS.INI - Config file for PRTXLS.SBX

[DATA]

IncludeTotals=1

 

[REMNANTS]

IncludeBlankLines=1

IncludeDupLines=1

SortBy=1

 

[ORIG]

;BGcolor options: silver,white,red,lime,blue,yellow,magenta,cyan,brown,green,navy,purple,gray,orange

BGcolor=silver

 

[POST]

AppendSeqno=1

SaveToDir=c:\vm\miame\dsk0\150502

SendToPC=1

Launch=1

; RemoteServer spec is IP address, colon, port

RemoteServer=11.111.111.111:222

RemoteServer=63.199.106.102:39899

IgnoreLocalServer=1

 

[MISC];ServerErrorURL=http://

 

Troubleshooting Export to Excel

If the Export to Excel function does not work, either at all or properly, perhaps understanding the sequence of events will help you find and fix the problem.

Requirements: Perl has been installed on the host computer or PC, as appropriate. The report has been displayed with the A-Shell print preview function.

1. The Export to Excel button is enabled if and only if the A-Shell subroutine PRTXLS.SBX is present and available. It should be located in the directory [7.6]. If the Export to Excel button is inactive (grayed out), it is because this file is missing.

   ATE only: the preview session of ATE (which itself is a second ATE session) launches another session of ATE to handle the export process. This job runs in the background and remains hidden except for the progress window.

2. PRTXLS.SBR creates a temporary working/debugging file called <sourcefilename>.XLX.

3. PRTXLS.SBR generates Perl script with the name <sourcefile>.PL.

4. PRTXLX.SBR executes PERL script. If the process breaks at this point, it is probably because the required Perl function "\spreadsheet\WriteExcel.pm" is not being found. This in turn may be because Perl is not installed, or because "\spreadsheet\WriteExcel.pm" is in the wrong location.

5. The Perl script runs and creates a spreadsheet file called <sourcefile>.XLS, which is placed in the xxx folder.

6. The temporary files (.XLX and .PL) are erased, and extra ATE session is shut down,

To assist in troubleshooting, you may want to use the debug function. To turn it on, check the "Debug" option on ATE's Connection Properties | Printer | General Options. If you are using A-Shell rather than ATE, get to the prompt and enter SET DEBUG.

Introduction

A-Shell Preview and EXport ("APEX") is a built-in component of A-Shell for Windows and ATE. At the user’s option or under program control, APEX receives a print file and re-directs it into a preview window. That window displays an image of the report and provides the user with various viewing options (zoom, multiple pages, single page, etc.). After previewing the report, the user may then print the report as it was originally intended to be printed (i.e., to the originally-specified printer), print it under user control (different printer, say, or landscape instead of portrait), or discard it. The purpose of the viewer, as with all such print preview functions, is to make sure that you are printing what you think you are printing—and to save time, energy, money and paper in the process. In some cases, viewing the report may eliminate the need for printing entirely.

APEX offers a variety of controls and options to facilitate viewing the report. Most of these items, and how to use them, are fairly obvious.

APEX also includes a valuable Export to Excel function, which is initiated by a button on the toolbar.

Following are some screen shots illustrating various aspects of APEX.

Title Bar and Tool Bar

The APEX title bar displays information about the report: original filename ("tstz" in this example), the first (-1) printing this session, temporary extension (.APF for "A-Shell print file"), the number of pages in the report, and Windows printer for which this report is intended, and the printer properties being used for printing. The toolbar provides options (in order from left) to set zoom percentage (10% to 999%); zoom in; zoom out; single page; multi-page grid (drop-down menu); page number / back / forward; print setup; print; help; close; print per application; find text (search); open another report; APEX preferences; export to Excel; export preferences.

 

Multi-Page Grid

Clicking on the multi-page grid option (see toolbar above) offers choices for the layout of multiple pages. You can (barely) see the grid choices below near the top left. The full screen shows the report in the 4 (across) by 2 (down) grid.

 

Find Text (Search)

Clicking the find text tool and entering a word into the "Find" dialog box ("exitcode" in this case) causes all the occurrences of "exitcode" on the current (first, in this case) page to be highlighted. Clicking "Find Next" displays the highlighted words on the next applicable page, etc.

 

Licensing

The programs and files needed by APEX are automatically installed on the PC with the underlying software (A-Shell for Windows or ATE). Starting from the date it is installed, APEX will work in unrestricted mode for approximately 30 days. After that free-trial period, APEX reverts to demo mode, which means that it will work so you can see its functionality, but with qualifications. When operating in demo mode, APEX will display an annoying message saying that it is in demo mode.

To enable full APEX operation on your PC, you will need to obtain an APEX software license from either your application provider/dealer or from MicroSabio.

Preferences

Several things about how the preview function behaves are under user control, and these things are set on the Preferences dialog. This dialog is accessible from both the menu bar in A-Shell/ATE (Settings | Preview Preferences) and from the Preferences button on the preview toolbar. The following screen shot, while not necessarily identical to the one shown in your version of the program, illustrates some of the user-controlled options.xe "Discard"

 

Preferences toolbar button: 

 

 

Preview on Print

Normal report printing consists of a report being created by a program, and then being sent to the PC for printing. The "Preview On Print" option allows you, the user, to control the circumstances under which those reports from the host, received for printing, are instead displayed on your screen. The "Always" and "Never" options should be fairly clear. The two "Application Control" options allow you to let the program that created the report determine whether the report is previewed--and gives you the option to say what happens when the report program doesn't specify anything.

There is no right or wrong, or best or worst, setting for this option. It is strictly determined by (a) your needs and objectives, and (b) those of your work environment.

The default value for this setting is "Application Control, Default=Off", which means that (a) APEX is expecting to receive a launch or don't launch command from the program that generated the report, and (b) if it does not get such a command, it will NOT launch.

On Exit from Preview

What do you want to happen when you exit the preview window (which, by the way, you can do by clicking on the "X" in the top right corner of the preview window, or by hitting the Escape key)? As you make your choice, keep in mind that all reports viewed with APEX are saved to disk; you can come back and view them again later if you wish.

Preview Window State

It is not possible for the program that launched the preview, or the programmer who wrote the program, to know how the user wants to deal with the preview: display the preview windows right now, or continue working and view the report later? The Preview Window State allows the user to set her preference for what happens when a report is sent to the preview window. "Visible (Foreground)" means that the preview window is shown right now. "Minimized (Background)" means that the preview window is created right now but then minimized; it appears in the task bar, which you need to click in order to view the report.

Preview File Retention

When a file is viewed using APEX, it is possible that the user may want to view this file again later. So as soon as a report is viewed, a copy of it is written to a file in the APEX folder. If the original file name being viewed is "report.xxx," then the file that is written into the APEX folder is called "report.apf" (apf = A-Shell Print File). These files remain in the APEX folder, and can be opened by the Open another report file button on the toolbar.

How long do they remain in the APEX folder? This is controlled by a setting on the Preferences called "Preview File Retention (hours)." The default value is 96 hours, 4 days, but you can set it to whatever you wish.

From an environmental perspective, the fact that you can view the report again later should make it easier to forego actual printing of every document (after previewing), merely out of fear that you might need it reference it in a few hours or days. The default setting of 96 insures that your disk won't get clogged up with more than four days worth of report files.

Files Requiring Preprocessing

Files that require processing before they can be displayed include GDI print files (i.e., those contain graphical printing commands), files printed through ATE, and any files using the PREFIX or SUFFIX options.

 

Possible options: "Close all previews on exit?"

 

Option: Delete report files after we're done with them? (or let them sit)

 

Ctrl +/- zoom increment %

 

Export to Excel: save to disk?

 

 

 

Keystrokes and Mouse Clicks

Keystroke

Action

 

Multi-page Mode

Home

Positions to the first group of pages, starting at the first page. The first page becomes the current page. testing.

End

Positions to the last group of pages, ending at the last page. The first page of the displayed pages becomes the current page.

Control+Home

Same as the Home key.

Control+End

Same as the End key.

Left Arrow

Moves to the previous page. The displayed group of pages is adjusted if necessary.

Right Arrow

Advances to the next page. The displayed group of pages is adjusted if necessary.

Up Arrow

Moves the first page of the displayed group of pages to the previous page (or sheet in duplex mode). The current page is adjusted if necessary.

Down Arrow

Advances the first page of the displayed group of pages to the next page (or sheet in duplex mode). The current page is adjusted if necessary.

PgUp

Displays the previous group of pages. The current page is adjusted if necessary.

PgDn

Displays the next group of pages. The current page is adjusted if necessary.

Plus on NP

Zoom in. ("NP" refers to the numeric keypad.)

Left Click

Display page clicked in single-page view at scaling of last single-page view.

1 (numeric)

Switches from multi-page mode to single page mode.

 

Single Page Mode

Home

Positions to the top of the current page.

End

Positions to the end of the current page.

Control+Home

Positions to the top of the first page.

Control+End

Positions to the end of the last page.

Left Arrow

Horizontally scrolls left on the current page.

Right Arrow

Horizontally scrolls right on the current page.

Up Arrow

Vertically scrolls up on the current page.

Down Arrow

Vertically scrolls down on the current page.

PgUp

Vertically scrolls up on the current page. At the top of the current page, move to the bottom of the previous page.

PgDn

Vertically scrolls down on the current page. At the end of the current page, advance to the top of the next page.

Plus on NP

Zooms in . ("NP" refers to the numeric keypad.)

Minus on NP

Zooms out. ("NP" refers to the numeric keypad.)

Escape

Close

Left click

Zoom in. Same as "plus zoom" button.

Right click

Zoom out. Same as "minus zoom" button.

Ctrl+PlusKey

Zooms in 5%.

Ctrl+MinuKey

Zooms out 5%.

2 (numeric)

Switches from single page mode to multi-page mode.

 

Both Modes

Escape

Close

Ctrl+P

Print

Alt+Ctrl+P

Toggles between main window (A-Shell or ATE) and Preview.

Ctrl+Enter

Toggles between multi-page and single page modes.

Ctrl+Alt+

Toggles between maximized and normal windows.

Ctrl+G

Go to page number control.

Ctrl+Z

Go to zoom control.

F1

Help

F3

Find

Operations

Zoom Percentage and Zoom In/Out

The Zoom Percentage control shows various steps of zoom. When you use the magnifying glass buttons to zoom in or zoom out, the steps by which you zoom are those shown in the zoom percentage control. You may manually set (by typing it in) the zoom percentage to any value between 10 and 1000. Note that when you are selecting a value for the zoom percentage control, and it has the focus, using the PageUp and Down key, as well as the up and down arrows, apply to the zoom percentage and not to the report being displayed. In other words, you can cycle through the zoom percentages by using those directional keys.

Find Text

This button on the toolbar will be grayed out (inactive) if the report being previewed does not contain any text—i.e., is all images and/or graphics. To initiate a text search, click on this button and enter the text to be found in the resulting dialog box.

 

Export to Excel

APEX includes an Export to Excel function which is initiated via a button of that name on the toolbar. There is also a button for setting the export preferences.

 

Print As Application Intended

This is rather an odd function to see in a Windows program, so a bit of explanation is in order.

Reports that are generated by A-Shell programs frequently are sent—by the report program—directly to a PC printer. In addition to the report, those print instructions include information for the printer, such as the name of the printer, number of copies, etc. However, APEX intercepts the report and (a) stops it from going directly to the printer, and (b) allows the user to now print the report using different parameters than the report program specified. Which is fine, and of course the user can print as he/she wishes.

But she might decide what she really wants, after looking at the report, is for it to be printed how the report program originally intended. Unfortunately she doesn't know what the report program intended; perhaps it was going to print six copies on a network printer called "Laser45."

By using this oddly-named button and function, the user can make sure that the report is handled and/or processed and/or printed as the original instructions intended.

If you do not need this function, just use the regular print operation.

 

Open another report file

See Preview File Retention in this document for information on what files may be opened and how they got here.

When you click this button, you will see a standard Windows file open dialog. Unfortunately, the list of file names that you see is probably not enough information to figure out what report it is you want to see. On the file open toolbar, you should see an icon near the top of the dialog box called Views, and one of its options is "details." If you click on the details icon, you should be able to see a little more information about the files. You may click on the column headers to sort by those columns in any effort to fine the report you're looking for. Unfortunately, not much information is available to you here, so you'll just have to open as many reports as it takes to find the one you're after.

Other Topics

Custom Extensions

You can add your own extensions to APEX, which are accessed as buttons on the toolbar and which call your own BASIC code, by defining them in the APEX configuration file, ASHCFG:APEX.CFG. The configuration file, if present, is scanned for commands of the following form:

BUTTON=prog, iconspec, tooltip {,msgno, inifile}

prog

indicates the subroutine which implements the extension. In theory it wouldn't have to be an SBX, but currently that is the only format supported, so prog must be in the form of "SBX:name", e.g. "SBX:PRTXLS". The corresponding subroutine (e.g. PRTXLS.SBX) must be in the BAS: directory (e.g. c:\ate\dsk0\007006\prtxls.sbx). The subroutine should be written according to the same interface specifications used by the printer initialization command line, COMMAND=SBX:... (see A-Shell Setup Guide).

iconspec

specifies the icon to display in the button that will be added to the toolbar. Supports the same syntax as for AUI_CONTROL icon buttons (see the A-Shell XCALL Reference).

tooltip

is a short tooltip to display when the mouse hovers over the button.

msgno (optional)

may specify a message number in the file <inifile.lng>, where lng is the current language extension, e.g. USA, to supply the tooltip text. If present, it overrides the tooltip parameter above.

inifile (optional)

may specify an initialization file used by the extension, although the details of how is is used are up to the custom code in prog.

The file may also contain any number of comment lines, each beginning with a semicolon in the first position. Here's , for example:

;APEX customization

;BUTTON=prog,icon,tip{,msgno,ini}

;If msgno>0, is expected to be msg 002,### in inifile.lng

BUTTON=SBX:PRTXLS,ashico1::document_out,Export to Excel,38,BAS:PRTXLS.INI

BUTTON=SBX:PXLCFG,ashico1::preferences,Configuration Options For Export,0,BAS:PRTXLS.INI

There are no particular limitations on what the subroutine (prog) may do, other than that it cannot delete or replace the file being previewed, and must eventually return so that APEX can resume control.

 

Debugging

In case of a problem launching the preview from ATE, use the debug message window to help clarify what is happening. Call up the A-Shell GUI Control Operations dialog with control+shift+double-right-click, then select Show Debug Dialog. When the debugging/trace window comes up, repeat the print attempt. It will log the command string that is actually being used, which might then be helpful to test independently, such as from Start..Run, or at least useful in identifying the problem.

Settings

In ATE, changes to Preferences are immediately stored with the connection profile in the Windows Registry. This means that they are both implemented immediately, and saved for future use; all subsequent operations of the preview window, whether in this session or new sessions, will reflect the latest settings.

In A-Shell/Windows, changes to Preferences are part of the overall A-Shell settings set which, along with the other options on the various Settings menu dialogs, are stored in the A-Shell settings (.ash) file. However, as with all other settings, changes made in the dialogs are not automatically written to the file. Thus, they only affect the current session. To make them permanent, you must save them via the File | Save option.

Files and Folders

The help file is called "apex.chm."

When you call up the Preferences menu, the actual words you see are taken from the file SYS:SBRMSG.USA. If you see odd codes in place of intelligible options, then your SBRMSG file is not being found.

Any temporary work files required by APEX are also created in the APEX folder.

The default location of the APEX folder is c:\apex, and this folder will be created the first time it is needed. If you don't like this folder and/or want it to be placed somewhere else, you may create an environment variable called "APEX" and point it wherever you wish.

Most of the print preview and display-related aspects of APEX are performed by a program module called "SftPrintPreview_###.dll" where "###" is platform and version information. This file lives in the main A-Shell or ATE folder on your PC.

Most of the export-to-Excel functionality is contained in the subroutine "prtxls.sbr." This file is found in DSK0:[7,6] of the A-Shell or ATE file system.

 

PRTXLS.INI Export Init File

Various operations and options in the export-to-Excel process are controlled by settings in the export initialization file, PRTXLS.INI. If this file is missing or an individual lines/statement is missing, APEX will use the value shown as "Default" in the table below. The init file is normally stored in the [7,6] directory or equivalent, although when PRTXLS.SBX is invoked from the COMMAND statement of a printer init file, the init file specification may be passed as an argument (e.g. COMMAND=SBX:PRTXLS,dsk7:xls123.ini[40,30]).

Note that each of the statements below must reside within the section indicated. Within a section, the order or presence/absence of a given statement is not relevant. The section names are in upper case, are enclosed in square brackets, and are preceded by a blank line. See the sample init file section.

As with many init files, lines beginning with semi-colons are comments and are ignored by the file processor. Comments can only occur on their own lines--i.e., cannot be appended to the ends of command lines.

Statement

Section

Values

Default

Description

IncludeTotals

DATA

0,1

0

If set, lines which look like totals or subtotals are treated as data lines.

IncludeBlankLines

REMNANTS

0,1

0

If set, blank lines are included in Remnants worksheet.

IncludeDupLines

REMNANTS

0,1

1

If set, duplicate lines are included in Remnants worksheet. (Otherwise only one line per set of duplicates is included.) For example, if set, the Remnants page may have many identical lines containing column headers.)

SortBy

REMNANTS

0,1

0

If set, Remnants lines are sorted by their contents.

BGcolor

ORIG

See sample init file

Silver

Background color of "Original" worksheet.

AppendSeqNo

POST

0,1

1

If set, a sequence number is appended to the XLS filename to make it unique.

SaveToDir

POST

Path specification

 

Directory where the XLS file is saved.

SendToPC

POST

0,1

1

(UNIX only) If set, causes the exported XLS file to be transferred to the PC using ATE/ZTERM FTP protocol.

Launch

POST

0,1

1

If set, the spreadsheet program (typically Excel) is launched to view the spreadsheet.

RemoteServer

POST

IP address: port

n/a

Specifies the location of a service to generate the XLS file. (Local generation requires that Perl be available and the WriteExcel add-on library be installed.)

IgnoreLocalServer

POST

0,1

0

Set to force use of RemoteServer even if local generation is available.

ServerErrorURL

MISC

URL

 

URL of page to display when an error related to the RemoteServer occurs.

 

Sample Init File

;PRTXLS.INI - Config file for PRTXLS.SBX

[DATA]

IncludeTotals=1

 

[REMNANTS]

IncludeBlankLines=1

IncludeDupLines=1

SortBy=1

 

[ORIG]

;BGcolor options: silver,white,red,lime,blue,yellow,magenta,cyan,brown,green,navy,purple,gray,orange

BGcolor=silver

 

[POST]

AppendSeqno=1

SaveToDir=c:\vm\miame\dsk0\150502

SendToPC=1

Launch=1

; RemoteServer spec is IP address, colon, port

RemoteServer=11.111.111.111:222

RemoteServer=63.199.106.102:39899

IgnoreLocalServer=1

 

[MISC];ServerErrorURL=http://

 

Troubleshooting Export to Excel

If the Export to Excel function does not work, either at all or properly, perhaps understanding the sequence of events will help you find and fix the problem.

Requirements: Perl has been installed on the host computer or PC, as appropriate. The report has been displayed with the A-Shell print preview function.

1. The Export to Excel button is enabled if and only if the A-Shell subroutine PRTXLS.SBX is present and available. It should be located in the directory [7.6]. If the Export to Excel button is inactive (grayed out), it is because this file is missing.

   ATE only: the preview session of ATE (which itself is a second ATE session) launches another session of ATE to handle the export process. This job runs in the background and remains hidden except for the progress window.

2. PRTXLS.SBR creates a temporary working/debugging file called <sourcefilename>.XLX.

3. PRTXLS.SBR generates Perl script with the name <sourcefile>.PL.

4. PRTXLX.SBR executes PERL script. If the process breaks at this point, it is probably because the required Perl function "\spreadsheet\WriteExcel.pm" is not being found. This in turn may be because Perl is not installed, or because "\spreadsheet\WriteExcel.pm" is in the wrong location.

5. The Perl script runs and creates a spreadsheet file called <sourcefile>.XLS, which is placed in the xxx folder.

6. The temporary files (.XLX and .PL) are erased, and extra ATE session is shut down,

To assist in troubleshooting, you may want to use the debug function. To turn it on, check the "Debug" option on ATE's Connection Properties | Printer | General Options. If you are using A-Shell rather than ATE, get to the prompt and enter SET DEBUG.