Beruflich Dokumente
Kultur Dokumente
TABLE OF
CONTENTS FOR
THIS MANUAL
Click in this box to see the Table
of Contents for this manual.
Appendix A
You can use ReportSmith with other Windows applications, combining your
work from several products into one application. ReportSmith supports this
function through Dynamic Data Exchange (DDE) and Object Linking and
Embedding (OLE). DDE lets you call ReportSmith from another application,
and vice versa. OLE lets you include objects from other applications in your
ReportSmith reports.
This appendix describes both methods (OLE and DDE), and presents
examples for each, including the following topics:
Using DDE
Using DDE
Dynamic Data Exchange (DDE) allows two Windows applications to
communicate by sending and receiving data and commands.
ReportSmith can be either a DDE client or a DDE server. A client application
makes requests of another Windows application. In turn, a server
application responds to requests from another application. Requests can
be commands or requests for specific data.
With ReportSmith, you can execute menu commands by Dynamic Data
Exchange (DDE) command from another Microsoft Windows application.
Appendix A, Using ReportSmith with other applications
171
Client
Server
Applications
Every Windows-based application that can participate in DDE conversations
has a unique application (or app) name. The table below shows the app
names for some common Windows applications:
Application
172
App name
ReportSmith
ReportSmith
Microsoft Access
MSAccess
Microsoft Excel
Excel
Program Manager
Progman
Users Guide
Application
App name
WinWord
ReportSmith Runtime
RS_Runtime
Topics
A topic defines the subject of the DDE conversation and represents some unit
of data meaningful to the DDE server application. ReportSmith supports the
System topic and the Command topic, as well as user-defined topics.
Items
An item is a reference to a piece of data or, in ReportSmiths case, a command
to execute. For example, an item could be a menu command such as File|
Open or a ReportBasic command such as LoadReport.
Note
Strings used for the application name, topic, or item in a DDE conversation
arent case-sensitive.
Calling ReportSmith
To start ReportSmith from another application:
1 First you must start ReportSmith from within another application. For
example, the following VisualBasic code starts ReportSmith(minimized
and without focus):
x = Shell("c:\rptsmith\rptsmith.exe", 6)
Important
Description
DdeExecute
DdePoke
DdeRequest
Refer to the online Help for details on the commands used to call other
applications.
173
view|zoom ( )
Menu name
Command name
You can also specify the option you want to use in the DDE command. For
example, if you want your application to magnify the object in its window up
to 150%, you enter the DDE command as follows:
view|zoom(150)
File|Open(BASIC.RPT)
File|Close
File|Print
View|Zoom(150)
DDE synchronization
You need to know when ReportSmith finishes executing the DDE command
if the client must wait until that process is complete. This is done by waiting
for the main application window to gain focus. The following VisualBasic
code demonstrates this.
' Use Windows API calls to detect when the report is finished loading.
RS_Window_Handle = FindWindow("SWAP:MAIN", "ReportSmith")
' Return if the ReportSmith window can't be found.
If RS_Window_Handle = 0 Then
MsgBox "ReportSmith Not Found"
Exit Sub
End If
Waiting = 0
While Waiting = 0
' Check if our main Window is Enabled it will be disabled
' until the report is loaded.
Waiting = IsWindowEnabled(RS_Window_Handle)
' Allow Windows to do its thing while we wait.
DoEvents
Wend
174
Users Guide
Double-click the
icon to open the
associated file
The main difference between linking and embedding an object is where you
store the data. When you embed an object in a report you are inserting
information into that report. Embedded objects become a part of the report
itself. When you link an object to your report, the report stores just the
location of the object and displays a representation of the linked data such
as an icon. Linked objects are stored in a source file and retain a connection
to the original Windows application.
Use embedding to include information that becomes a part of the report and
is always available, even if the original source file is absent or moved. You
can also use embedding to include a file that may not always be available,
such as a file residing on a network.
Use linking to include data in your report that is maintained in a separate file
and to save space. The ReportSmith report will reflect any changes made to
the source file and always displays the last-saved version. Also, you can use
linking to include a very large file such as a video or sound object in your
report.
175
1 Select the Object command on the Insert menu. The Insert Object dialog
box appears.
ReportSmith can accept and embed objects from any applications youve
installed on your workstation that fully support OLE. In this example,
well insert a Microsoft Graph into the page header of our report.
2 Double-click the application you want to use to create the object from the
Object Type list box. Alternatively, select the application you want to use
and click the OK button.
The Object cursor appears.
3 With the mouse, position the Object cursor within the header or footer
where you want to place the object.
4 Left-click the mouse. The application opens so you can create the object
youll embed in the report. Since we chose Microsoft Graph, Microsoft
Graph opens.
5 Create the object.
6 Select the applications Update or Return command from the File menu.
ReportSmith places the object where you click in the report. Click to select
the header or footer if the object exceeds its boundaries. Click and drag
one of the four-corner handles until you can see the entire object within
the header or footer boundaries, then release the mouse button.
The object
appearswhere
you drop it
176
Users Guide
1 Double-click the object and ReportSmith opens the application so you can
see the object you want to edit, or single-click the object to select it.
2 Select the Object command from the Edit menu.
Note
The application name appears on the Edit menu, along with the Object
command. For example, Edit Microsoft Graph Object appears as the
command name if the object you select was created in Microsoft Graph.
ReportSmith opens the application and displays the selected object you
want to edit.
Dont close the application from which youre copying the object until youve
selected the Paste Link command. If you close it before, Paste Link command
wont be available on the Edit menu.
177
3 Press the Update Now button if you have Manual set as the Update
option and you want to update the object or if the report the object is in
was open when changes were made to the original file. ReportSmith
updates the object.
To cancel a link:
1 From the Edit menu choose Edit Links. The Links dialog box appears. The
Edit Links command is available only if youve created links. If you
havent, the command is dimmed on the Edit menu.
2 Click the link you want to cancel in the Links list box.
3 Press the Cancel Link button. ReportSmith cancels the link and the Links
options for that link are dimmed.
To change the location of a link:
1 Select the Edit Links command from the Edit menu. The Links dialog box
appears. The Edit Links command is available only if youve created links.
If you havent, the command is dimmed on the Edit menu.
2 Click the link you moved to a new location.
3 Press the Change Link button. The Change Link dialog box appears.
4 Type in the new path for the linked object. ReportSmith changes the link
so it can continue to update the object if any changes are made.
Users Guide
3 Holding the Shift key, drag and drop the object into the receiving
application.
The object appears in the receiving application.
To move an object from one application to another:
179
180
Users Guide