![]() |
![]() |
| ||
| Search for an article | ||
All Forums![]() Advanced Techniques![]() |
|
| Article: NAV145 | Extending Eclipse with additional utilities |
| Summary: | Before any report prints from Eclipse it is possible to automatically run another programme first to carry out some special tasks. This programme may have a visual interface or may run behind the scene; it may provide the user with some addition fields to fill in which will be stored in a database or it may update a database field after making some calculations. Either way, the print preview form in Eclipse will not appear until this programme has finished doing its stuff . The most likely reason for running such a programme would be to make database changes which will be reflected in the report you are about to print. A couple of examples of this technique is used in the reports that come with the Eclipse Toolbox package. How it works If you go to a Report entry in the Eclipse Configuration Utility and click the details button you will see all the data fields available for the report's configuration. The TWO fields of interest to us here are RunProgramme and CommandLineParameters. To get a programme to run just before a report prints simply copy the programme to the same folder as Eclipse.exe and enter the full name of the programme, including file extension, into the RunProgramme field, e.g. JSched.exe. The CommandLineParameters field is an optional but powerful feature
used for passing extra information to the programme about to run as a command
line parameter. The most likely use of this facility would be when the programme
you are about to run needs to know which record of a database table you are
currently working on in Eclipse. For example, you may want your programme to
allow the user to enter extra information about an equipment list and have
information stored in a Paradox database table you have created for this
purpose. Of course, to be of any use the new table will need a link field back
to the main Eqlists.db table in Eclipse so you will have an integer field in the
table (probably the 'key' field) which stores the value of Eqlists.Eql_no. Your
reports can then use this table once it has been added and linked. The question
is, how can I know which equipment list I am currently working on? Well, Eclipse
already passes this information to Crystal Reports using the Value field
of the Reports configuration tab and you may be familiar with typical entries
such as this: wwtable3eql_no.asstring. This tells the report to go to the
current equipment list that is open in Eclipse and to use that record in the
database as the source of the data you want to retrieve. We do something similar
in the CommandLineParameters field and we use whatever entry we find in
the Value field but in a slightly different format,e.g. <wwtable3eql_no> Implementation Eclipse is written in Delphi (32-bit) and uses the Borland Database Engine with a Paradox database. We have created a sample project in Delphi 5 (it will work with all 32-bit Delphi versions) which can be downloaded from <HERE>; it includes a compiled executable so even non programmers can download it and use it they wish. The project is a simple one: it gives your users a 3 field form they can fill in when you print an equipment list based report. The extra information in stored in a new table called Extra_Eqlist.db. Some brief instructions are in the zip and we must emphasise that support for these advanced facilities is restricted to the Club forums only New in Eclipse 2.3 There is now an additional field in the Advanced Setup for a report: Run Programme Only. If this is checked then a report is NOT required to be assigned to the report entry and your programme will launch from the File / Run menu in Eclipse |
| Last Updated: | 10 December 2001 - 16:14 |