ReportLink v0.94b
Paradox Report Printing Component for Delphi
Developed by Pencilneck Software
Copyright (c) 1995-1996 by Todd Fast.  All rights reserved.
v0.91b Released 9-14-95
v0.92b Released 9-17-95
v0.93b Released 9-21-95
v0.94b Released 11-23-95
This document revised 4-9-96

Updates to ReportLink, including 32-bit versions of ReportLink

For the latest release of ReportLink, please check www.eden.com/~tfast.  32-bit versions of ReportLink should be available in early in May.

What is ReportLink?

ReportLink is a component that allows developers to print Paradox reports from their Delphi applications using the full or runtime version of Paradox for Windows 5.0.  ReportLink encapsulates all the printing flexibility that Paradox supports into an easy-to-use Delphi native component.  In addition, developers can run preliminary scripts and QBE strings before executing the report, allowing them to make any preparations necessary for their reports.  ReportLink also provides a full featured print preview function which includes a suite of Paradox components that the developer can customize.

Features:
Print any Paradox report (or group of Paradox reports*) from Delphi with or without any run-time requests or splash screens.
User can print directly or preview the document before printing.
Print preview is handled by a Windows 95-style custom toolbar which can be replaced by your  custom forms.
Developers can run a preliminary QBE query and a custom script to do any processing necessary for the report
The Paradox components are replaceable modules and come complete with a full-featured API that developers can use to create their own custom ReportLink-compatible Paradox objects.
Robust handling of Paradox errors, including reporting the errors back to your Delphi application.
Event hooks that developers can use to respond to Paradox events, including errors.
Paradox automation, allowing the user to send messages to Paradox directly through the ReportLink component.
A full-featured report selector dialog that developers can use before running Paradox to allow users to select the reports they want to print.*
Only one Paradox session must be run by ReportLink; printing further reports uses a handle to the first session*

*Not present or only partially complete in this release.


What's included in this ReportLink package?

What you have is a beta release of the ReportLink component.  This version (noted above) is FREEWARE.  This version of ReportLink is not crippled in any way and is fully functional.  You may use this version of the component for any personal or evaluation purpose you wish.  You may not use this version of the component for commercial or corporate applications, however.

Other versions of ReportLink (beginning with v1.0) are SHAREWARE.  You have 30 days to evaluate these versions of the ReportLink component before you must register it (see below).  

Of course, I can't make you register ReportLink, and I expect many of you won't.  However, you do get some nice things for registering, including the following:
Full version of ReportLink with source code, including the source for the Paradox clients (yes, that cool toolbar form too)
License to use and distribute ReportLink as a part of your custom applications
Eligibility to receive updated release of the same version.
Eligibility for free upgrade to next higher full version.
My full attention for customer support.  If I am unable to fix your particular problem (as long as the problem is unrelated to the features or limitations of Delphi or Paradox for Windows) I will issue you a full refund of your registration fee.
My unending gratitude.

In addition, as a registered user, you may, by special agreement, be eligible to design and have included with further releases of ReportLink enhancements to ReportLink (with full credit of course).  Also by special arrangement, you may be eligible to receive a free, fully registered version of ReportLink.  Please contact tfast@eden.com for more information.

For registering, you will NOT receive the following:
Any rights to the source code or ReportLink component except as outlined above.
The right to use the ReportLink source code to develop a competing product.
The right to distribute the registered version of ReportLink other than in compiled form as part of your custom applications.
The right to use ReportLink within a corporation (see site-license information below).
The right to use the name "ReportLink" for identifying any of your custom modifications.  This right will be reserved for those collaborating on ReportLink with me, Todd Fast, the original developer.
The right to redistribute your custom modifications to ReportLink other than as functional, necessary parts of your custom applications.

Whether you use the registered or unregistered version of ReportLink, neither Todd Fast nor Pencilneck Software will be liable for any damages incurred through the use of ReportLink.

Registering Details
The price to register a single-user license to ReportLink is US$25.  To register, please send the information below along with a check or money order to the following address:

Pencilneck Software
c/o  Todd Fast
5107 Leralynn #104
Austin TX  78751
USA
tfast@eden.com

Please make the check payable to me, Todd Fast.  Please make all payment in US funds.

Please include the following information with your order (I will not process the order without it):

Name
Address
Phone number
Occupation
Company
Intended use of ReportLink
Email address that I can send a zipped package of the latest version of ReportLink. to
Any other interesting information about yourself you'd like.
Note:  I will only send the software to you over the Internet with MIME encoding.  No UU encoding please.

On receipt of your order, I will send the latest, zipped version of ReportLink to the email address you've specified.  If you would like to receive a disk and printed documentation for ReportLink, please include an extra $5 with your order.

The above registration information is valid only for non-commercial use or use as outlined in the agreement above.  To use ReportLink for corporate applications (i.e. within a corporation), please contact Todd Fast at the address above for site-license information.  You may also send requests by email to tfast@eden.com.  Site-license pricing will depend on the size of your company.  There will be a maximum of $250 for an unlimited use site-license:

***Note new pricing***
0-99 people:	$100
100-250 people:	$200
250+ people:	$250

Corporate eligibility for updates and upgrades is the same as for the single-user license decribed above.  Site license pricing may be negotiable.  I may also be contracted to customize ReportLink for your corporate needs.  Contact tfast@eden.com for more details.

Finally, this version of ReportLink may be redistributed without limitation, provided the original ZIP'ed package is kept together and unmodified.  Under no circumstances may ReportLink be distributed as part of a shareware collection except by express permission of Todd Fast and Pencilneck Software.  There may be a fee for agreement to this type of redistribution.  Please contact Todd Fast at the above address for more information.


How do I know if I want it?

Well, to this end, I've included a demo form that demonstrates the features of this beta release of ReportLink.  Note:  You will need the full or runtime version of Paradox 5.0 to run the demo.

To install the demo, copy the following files to a temporary directory:
TEST.RSL	(test Paradox report file)
TEST.SSL	(test Paradox script file)
REPLINK.FDL	(ReportLink Paradox main form)
REPLINK.LDL	(ReportLink library; contains ReportLink API that custom forms and scripts can use)
REPLINK.SDL	(ReportLink Paradox script, used to initialize ReportLink and load REPLINK.FDL)
RLDEMO2.EXE	(ReportLink demo application)

To run the demo,
Double-click the file called RLDEMO2.EXE in File Manager or Explorer
In the fields "ReportLink Dir", "Paradox Work Dir", Report "Path", and Script "Path", enter the name of the temporary directory containing the above files.
In the "Paradox Path", type the name of the directory containing your full or runtime version of Paradox.
Set any other options you desire and press the "Print" button to run the test report from Paradox.  The test report will show you the contents of the ReportLink main table.  Note:  you will only see the properties that differ from their default values.

Note:  The test report included in this package show you the contents of  the ReportLink main table which is created by ReportLink at run-time. ReportLink creates this table in the Windows directory, which is usually C:\WINDOWS.  To simplify the demo, the test report provided in this package uses a hardcoded path to this directory.  If your Windows directory differs from this directory, you will receive an error on trying to open the test report.  There are two ways to eliminate this problem:
You can provide a path to the Windows directory and the table name "__REPLNK.DB" in the Master Table field of the demo form.  (You MUST type the name because Paradox doesn't list tables with the first two characters "__".)  This hot-swaps the master table of the report with the one you've specified.  If you choose a table other than the ReportLink table, you will receive errors as Paradox tries to map the report's field structure to the structure of the table you selected.  The report should still open, though.
You can try to open the report, but you must choose the option to choose a new table.  In the open table dialog, move to your Windows directory and type "__REPLNK.DB" in the table name field and press OK.  This action has the same result as the step above.


How to Install ReportLink into Delphi

Installation of ReportLink is very simple.  First, copy the following files to a directory containing your components:

REPLINK.DCR
REPLINK.DCU
REPLINK.RES
RLABOUT.DCU
RLABOUT.DFM
RLREG.DCU
RLREG.DFM

Follow your Delphi documentation for installing the component file REPLINK.DCU.  Copy the following files to a directory on your hard drive that Paradox can access:

REPLINK.FDL
REPLINK.LDL
REPLINK.SDL

Paradox will use these files to run the Paradox side of the ReportLink connection.  Now you can drop the ReportLink component on your form, specify the necessary paths (see demo description above) and report away.


What do I do if I have problems, questions, or suggestions?

That one's easy--contact me directly at tfast@eden.com.  I will try to handle your questions in as timely a manner as I can manage.  If you are contacting me about a bug, please mention the word "bug" in your subject line so that I can expedite a fix.  I strongly encourage you to try to determine if the problem you are having is indeed a ReportLink problem before contacting me.  Although I enjoy helping any way I can, there's only one of me, and potentially many of you.

If you are interested in collaborating on ReportLink and feel you have capabilities that would benefit ReportLink or Pencilneck Software, please send an inquiry with your proposal to the above address.

Finally, if you like ReportLink and it helps you get your work done better, please drop me a note and let me know.


How ReportLink Works

ReportLink works by allowing the developer to specify report options in Delphi that can be passed to Paradox for Windows (full or runtime version).  ReportLink uses a table coupled with custom Paradox objects to pass parameters to Paradox and print the requested report(s).

Precautions:
ReportLink only writes the values into the table that differ from defaults.  These values are the only values that will appear in the test report.
All paths must end with a "\".  (This will be handled automatically in future releases).
If ReportLink can't find the executable for the full version of Paradox, it tries to run the runtime executable.  If this attempt fails, ReportLink generates an error.
ReportLink places its master table used to communicate with Paradox in the Windows directory.

Requirements:
Microsoft Windows 3.1 or compatible (includes Windows 95)
Paradox for Windows 5.0 (full or runtime version)
Delphi for Windows 1.0
8 meg (16+ recommended for best performance)  8 meg can be very slow, particularly if you are running Windows 95


ReportLink Component Methods

procedure Execute;
Runs ReportLink with the specified properties.  Normally, this method will run the report named in the ReportPath+ReportName properties from Paradox.

procedure CloseReport;
Sends a message to the ReportLink Paradox client to close the current report.  Note:  This method has no effect in this version of ReportLink.

procedure CloseApplication;
Sends a message to Paradox, telling it to close itself.

procedure SendParadoxMessage;
Sends the command in the ParadoxMessage property to Paradox for processing.  The messages possible for this release are the following: pmClose, pmMaximize, pmMinimize, and pmRestore.

procedure ShowAboutForm;
Shows the ReportLink About form which contains version and registration information.


ReportLink Component Properties

EndPage		(see below)
MakeCopies		(see below)
MasterTable	(see below)
ReportPath		Path to the desired report.  Must end in a backslash "\" to work properly.
ReportName	Name of the report to print.  Needs to end with an extension, ".RDL" or ".RSL".
Orientation		(see below)
PageIncrement	(see below)
PanelOptions	(see below)
PrintBackwards	(see below)
QueryString	(see below)
RestartOptions	(see below)
StartPage		(see below)
StartPageNum	(see below)
XOffset		(see below)
YOffset		(see below)
ParadoxPath	Path to PDOXWIN.EXE or PFWRUN.EXE on user's system.  You may want to configure this info for each user through an INI file.
ReportLinkDir	Path to the REPLINK.FDL form file.  Paradox will search this directory to find the ReportLink files.
ReportLinkMode	The mode which ReportLink will run Paradox.  Possible values are the following:  rmOpenFullParadox, rmOpenRuntimeParadox, rmViewSingle, rmPrintSingle
RunQuiet		Tells ReportLink to run Paradox with or without the splash screen.
ScriptPath		Path to the Paradox script that ReportLink will run before running the specified report.  Must end in a backslash "\" to work properly.
ScriptName		Name of the Paradox script to run before running the specified report.  Needs to end with an extension, ".SDL" or ".SSL".
ParadoxHandle	Read-only.  The window handle of the instance of Paradox currently running.  If no instance is running, this property returns zero.  This property is assigned once the instance of Paradox has opened.
PollFrequency	Time in milliseconds between polls of the ReportLink connection.  The ReportLink component uses this polling technique to determine if Paradox has been closed without notification as well as the general state of the Paradox-Delphi link.
IsParadoxOpen	Read-only.  Logical property that reflects the current state of the ReportLink connection.  This property is assigned only once the ReportLink Paradox client sends a message to the ReportLink component that it has opened.
EnablePoll		Determines whether the ReportLink component polls the ReportLink connection.  This property is set internally by the component, but can also be changed manually.  There should generally be no reason to manually override the value of this property; doing so may cause unpredictable behavior.
AutoUnload		This property has no effect in this version.
RunMinimized	If TRUE, Paradox will load minimized, only showing itself once the ReportLink Paradox form has opened.
IsLinkTable		Read-only.  TRUE if the ReportLink table has been created in the current session.
ParadoxMessage	Enumerated property containing the command sent to Paradox when the SendParadoxMessage method is called.  Possible values are the following:  pmClose, pmMaximize, pmMinimize, and pmRestore
PollsBeforeTimeout	The number of polls the ReportLink component will make before deciding that running Paradox was unsuccessful.  Polling begins once the component has verified that Paradox was opened.
About		Read-only.  Information about the current version of the ReportLink component
ParadoxPrivDir	You may specify the private directory for the Paradox session with this property.  Setting this property adds a "-p" switch Paradox command line
ParadoxWorkDir	You may specify the working directory for the Paradox session with this property.  Setting this property adds a "-w" switch to the Paradox command line.


ReportLink Component Events
The ReportLink Paradox client sends various notifcation messages back to the ReportLink component.  The following events allow you to respond to these messages:

OnParadoxOpen	Triggered once the ReportLink connection has been established, after Paradox has opened.
OnParadoxClose	Triggered when the current session of Paradox closes.
OnReportOpen	Triggered when the ReportLink Paradox client opens a report.
OnReportChange	Triggered when the ReportLink Paradox client makes a different report the current report.
OnReportClose	Triggered when the ReportLink Paradox client closes the current report.
OnParadoxError	Triggered when the ReportLink component generates an error condition.  The error code and message are passed to this event.  Note:  This version does not yet implement supplying an error message.  Also, this event is only triggered when there is a ReportLink client running in Paradox.  If an error occurs before or after the client is running, this event will not be called.
OnParadoxTimeout	Triggered when the number of polls executed exceeds the number set in the PollsBeforeTimeout property.  This method is useful for allowing your code to recover from a non-ReportLink Paradox error (generally on startup).  Note:  You do not need to manually close an instance of Paradox if it times out--this event's default handling will close the instance since there is no further way to communicate with it.



Print Property Descriptions
(ReportPrinterInfo Structure Details from Paradox 5.0 docs)

endPage		The last page of a range. Default: last page of the report.
makeCopies		Specifies how copies are made: by Paradox or the printer. True = Paradox make copies; False = printer makes copies. Default: True. The value is ignored if the printer cannot print multiple copies.
masterTable		Name of the master table for the report.
name		Name of a report to run, if it's not already running.
nCopies		Number of copies. Default: 1
orient		Page orientation. Landscape or Portrait
pageIncrement	Page increment for multi-pass printing. Default: 1
panelOptions	Specifies how to handle overflow pages. Use one of the ReportPrintPanel constants. Default: PrintClipToWidth
printBackwards	Specifies whether to print forward (from first page to last page) or backward (from last page to first page). False = forward, True = backward. Default: False
queryString		Specifies a QBE string to execute.
restartOptions	Specifies what to do when data changes while printing report. Use one of the ReportPrintRestart constants. Default: PrintReturn
startPage		The first page of a range. Default: 1
startPageNum	(Added in version 5.0.) The page number to print on the first page of the report. Incremented for subsequent pages. Default: 1
xOffset		Horizontal page offset. Default: 0
yOffset		Vertical page offset. Default: 0



ReportLink Library API (Function Prototypes from REPLINK.LDL)
Almost all the ReportLink Paradox client functionality is encapsulated in the Paradox library REPLINK.LDL.  This fact means that you can develop your own custom ReportLink Paradox client components, rather than using the ones that come with ReportLink.  Although the functions are fairly straightforward, I suggest obtaining the source code for ReportLink to study to see how your clients should interoperate with ReportLink.  You can obtain the source code to the ReportLink component and the Paradox clients by registering your version of ReportLink.

ClearApplicationHandle() Logical
Deletes the Paradox application handle record ("ParadoxWindowHandle" of the System type) from the ReportLink table.  The return value specifies if the method was successful.

ClearErrors() Logical
Deletes all error message records ("ParadoxError" of the System type) written to the ReportLink table.  The return value specifies if the method was successful.

CloseParadox()
This method sends a PM_PARADOXCLOSING message to the ReportLink component and then calls Paradox's exit() method.  This method is the preferred way of ending a Paradox/ReportLink session, and ensures that your custom applications will remain compatible with later versions of ReportLink that may need to do more processing before closing Paradox.

CloseReport(var aReport Report) Logical
This method closes the report specified in the single parameter.  It also sends a PM_REPORTCLOSED message back to the ReportLink component.  The return value specifies whether the report was successfully closed.

EnablePoll(const theState Logical)
Although not yet implemented, this method will allow you to start and stop the polling of the ReportLink table for new information.

GetLinkTableName() String
Simply returns a string that is the full path and file name to the ReportLink table.  Currently, that string is equal to the Windows directory + the file name, "__REPLNK.DB".

GetCurrentReport(var aReport Report) Logical
previously GetReportHandle(var aReport Report) Logical
Returns the handle of the most recently loaded report in the passed parameter.  Returns FALSE if no report has been loaded.  Note:  This function may return TRUE although the current report handle may have been invalidated by closing the report.  It will only return FALSE before any reports have been loaded, and will then return TRUE thereafter.

GetReportLinkHandle(var theHandle SmallInt) Logical
This method returns the Window handle of the ReportLink component on the Delphi form.  You may use this handle just like any other handle to a windowed component, although certain messages won't make much sense (like minimize and maximize).  This method allows you to send Windows messages to the component directly, bypassing the SendReportLinkMessage method.

GetReportPrintInfo(var RPI ReportPrintInfo) Logical
Parses and returns the information specified in the ReportLink table into a Paradox ReportPrintInfo structure.  This call is not used internally by the LoadReport() and PrintReport() methods as it was previously.  It returns FALSE if there is an error getting the minimum information necessary (i.e. report name) or if it cannot access the ReportLink table.

GetProperty(const theProperty String) String
This method read the property specified in the single parameter from the ReportLink table and returns the string in the "Value" column.  If the property is not found, this method returns a null string ("").

Init() Logical
This method initializes the library and should be called immediately after opeing the library.  The return value specifies if the initialization was successful.  Your client application should terminate if this method returns FALSE.

LoadReport(var RPI ReportPrintInfo,var aReport Report) Logical
previously LoadReport(var aReport Report) Logical
Loads the report specified in the ReportLink table with the passed ReportPrintInfo structure and displays it as a print preview.  The handle to the loaded report is returned by the second function parameter.  After this call, the REPLINK.FDL form can then be used as a toolbar to allow the user to interact with the report without allowing the user to compromise the Paradox environment.  This call also sends a PM_REPORTOPEN message to the ReportLink component, triggering the OnReportOpen event.

PollTable()
Although not implemented in this version, this method will allow ReportLink cleints to receive messages from the ReportLink component after initialization (Paradox forms cannot receive custom Windows messages, making this method necessary).

PrintReport(var RPI ReportPrintInfo) Logical
previously PrintReport() Logical
Prints the report specified in the ReportLink table with the passed ReportPrintInfo structure directly without showing Paradox.

PlayScript() Logical
This method plays the custom Paradox script specified in the ReportLink table.

SetCurrentReport(var aReport Report) Logical
This method makes the report specified in aReport the current report.  Certain methods like SetReportMenu only work with the currently selected report.

SetProperty(const theProperty String,const theType String,const theValue String) Logical
This method allows you to write a property value back to the ReportLink table.  If the property specified in theProperty already exists in the table, it will be overwritten.  Otherwise, the method will insert a new record with the values you specify.  You can use this method to pass more detailed information back to the ReportLink component from your custom ReportLink clients.

SendReportLinkMessage(const MsgCode SmallInt,const wParam SmallInt,const lParam LongInt)
This method is by far the most powerful of all.  It allows you to send messages back to the ReportLink component directly using a Windows message.  Note:  The ReportLink component will only respond to the predefined messages listed below.  If you want to define your own responses to custom messages, you must subclass the component or purchase the full version of ReportLink so that you can modify the source (you will probably need the source to make your code effective anyway).  Here are the predefined messages reportLink will respond to:

PM_PARADOXOPEN=0		The ReportLink component expects the application handle to be passed in the wParam of this message.
Example:  SendReportLinkMessage(PM_PARADOXOPEN,theApp.windowHandle,0)
theApp is a previsoulsy declared variable of the Application type.

PM_PARADOXCLOSING=2	This message should be sent right before the client software closes Paradox.  Sending this message invalidates the ReportLink component's connection, and your custom client application is responsible for closing Paradox.  Sending this message without subsequently closing Paradox will leave Paradox open without the ReportLink component being able to access it.

PM_REPORTCHANGE=10 	This message should be sent when the current report is changed.  It is not used by the Paradox client supplied in this version of ReportLink.

PM_REPORTOPEN=11		This message is called when the LoadReport() method is called and is successful.

PM_REPORTCLOSED=12		This message is called when the CloseReport() method is called and is successful.

PM_PARADOXERROR=20	This message is called from within the WriteError() method.  ReportLink expects to find the error code in the wParam of the message.  The defined error codes are defined in the description for WriteError().

SetReportMenu()
Used by the LoadReport() method to specify a safe, standard menu for the report in the print preview window.

ShowErrors(const theState Logical)
This method allows you to specify whether the WriteError method will display errors as they occur.  A value of FALSE will suppress any error dialogs.

TBSetPosition(const FormTitle String,const x LongInt,const y LongInt,const w LongInt,const h 	LongInt)
This method is used by the ReportLink REPLINK.FDL form to allow toolbar-like behavior.  It overcomes a problem with some of the Paradox ObjectPAL RTL methods.  Your custom Paradox clients can also call this method to reposition themselves at the new coordinates passed in x,y,w, and h.  This method is useful if you are using a form that doesn't have a title bar and you are forced to emulate one manually (as the REPLINK.FDL form does).

WriteApplicationHandle() Logical
Writes Paradox's application handle to the ReportLink table.  The value is written to the property "ParadoxWindowHandle" of the "System" type.  This method does not send a message to the ReportLink component.

WriteError(const ErrorCode SmallInt,const ErrorString String)
previously WriteError(const ErrorString String)
This function writes the error string and error code to the ReportLink table named by GetLinkTableName() function for use by the Delphi component.  The method causes a new "ParadoxError" record of the "System" type to be added to the table, regardless if one or more already exist in the table.  The error message is written to the "Value" column, and the error code is written to the "Tag" column.  This method sends a PM_PARADOXERROR message to the ReportLink component with one of the following error codes in the wParam of the message:

(Error=ErrorCode)
ERR_OPENFORM=100
ERR_INITFORM=118
ERR_ATTACHFORM=103

ERR_UNDEFRLHANDLE=102
ERR_UNDEFSCRIPTNAME=109
ERR_UNDEFRLWINHANDLE=110
ERR_UNDEFRLDIR=116
ERR_UNDEFRLMODE=117
ERR_UNASSIGNEDREPORT=112

ERR_LOADREPORT=101
ERR_PRINTREPORT=107
ERR_ATTACHREPORT=111
ERR_REPORTCLOSE=119

ERR_GETPROPERTY=114
ERR_SETPROPERTY=115

ERR_CLEARAPPHANDLE=106
ERR_CLEARERRORS=108

ERR_POSTRECORD=104
ERR_OPENRLTABLE=105

ERR_OTHER=113

You can use this list of error codes to respond to a particular error in the OnParadoxError event.  Note:  These messages are only sent from the ReportLink Paradox client.  Error messages generated external to the client will not send an error notification to the Reportlink component.


Cautions When Using ReportLink
To get the most out of ReportLink, it helps to be skilled with Paradox, Delphi, and Windows programming.  Although I've designed ReportLink for anyone to use, there are some things to watch out for, particularly with Paradox.

Paradox is generally a very powerful application.  Unfortunately, this power is not always understood by the person using it, or using ReportLink with it.  The most important thing to understand is that Delphi and ReportLink are both IDAPI/BDE applications (well, Delphi is if you use any database components). This means that there are potential conflicts between applications running simultaneously on one machine.

There are three concepts that are most important for you to learn to use Delphi and Paradox database applications simultaneously.  These concepts are how the private and working directories work, and how aliases are shared between different IDAPI applications.  I cover these concepts briefly below.

1)  Private directories.  Private directories are directories used by IDAPI/BDE to store temporary tables.  These directories cannot be shared.  When each instance of IDAPI initializes, it locks it's private directory so that no other IDAPI instances can access it.  If you specify a private directory for an IDAPI session that is already locked, you will recieve a "Cannot initialize IDAPI.  Directory is busy" error.  For this reason, it is important that you do not specify the ReportLink ParadoxPrivDir property to point to another application's (like yours) private directory.  (Note:  In Paradox, the private directory can always be accessed through the ":PRIV" alias.)

2)  Working directories.  Paradox uses the concept of a directory as a single database.  The current database is then the currently open directory, which is specified by the working directory.  Although the concept of a working directory simplifies certain database operations, it is generally too limited to be of use to more advanced applications, particularly applications deployed to different locations.  This leads me to the next important concept.  (Note:  In Paradox, the working directory can always be accessed through the ":WORK:" alias.)

3)  Aliases.  When writing IDAPI applications, you should ALWAYS use aliases to access tables.  I cannot overemphasize how important this technique is.  Not only does it allow parts of your applications to be moved to different directories, but it allows seamless upscaling of your applications to client/server systems if necessary.

Aliases are stored in IDAPI configuration files.  Although the Delphi documentation doesn't mention this, you can use any IDAPI config file you want, not just the IDAPI.CFG file in the IDAPI directory.  This file can be located anywhere.  In Paradox, it is extremely easy to change config files on the fly--all you need to do is add a "-o" switch to the command line followed by a config file name complete with path.  Delphi applications are not this easy to work with, and will generate a fatal exception if they cannot find the IDAPI config file in the IDAPI directory.  As far as I can tell, you must use a loader to make the switch before loading your main application to prevent this error.  The implication of this fact is that generally you need to add any aliases your reports use programmatically either from within Delphi or in the preliminary script that ReportLink runs before running any reports.  This means that is even more important that you use aliases to reference tables in your reports.  Relying on the working directory to allow your reports to open without errors is an error-prone practice and should be avoided.


Planned Enhancements for ReportLink v1.0-1.9*
*The listing of the following planned features in no way obligates Pencilneck Software or Todd Fast to provide them.

Print multiple reports at once.
Detection and use of previous ReportLink/Paradox session--Paradox won't need to be reopened for each report.
Built-in INI file support for saving path information.
Print reports from MS Access as well as Paradox; perhaps other reporting tools
Configurable Report selection dialog, including multiple report handling and viewing
Automatic detection and addition of "\"'s at the end of paths


Disclaimer & Copyright

These programs are Copyright (C) 1995-1996 by Todd Fast.
All Rights Reserved.

It is provided as shareware unless otherwise stated with the following limitations:

These programs are shareware and are not to be resold or distributed for sale
with other programs which are for sale.  There is no warranty or claim of
fitness or reliability. The programs are distributed AS IS, and as such neither
the author nor Pencilneck Software shall be held liable for 
any loss of data, down time, loss of revenue or any other direct or indirect 
damage or claims caused by these programs.
