Kbase P18420: Example of how to overwrite the connection for two Databases
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  8/22/2003 |
|
Status: Unverified
GOAL:
Example of how to overwrite the connection for two Databases when calling the Report Builder engine
FIX:
To overwrite two DB connections is necessary to use Prore (that uses an intermediate table).It is not possible to use _printrb.
Create a Database called reportdb and load the reportbd.df located in the %DLC%\bin in order to create the hidden table RBREPORT with all the necessary fields. Start the reportdb.
This example "prints" the report into a text file (RB-PRINT-DESTINATION="A"),
The Report was designed against two tables called mitad1 and mitad2 (the kind of connection against them could be any one).Now in the RB-DB-CONNECTION I am using mitad3 instead of mitad1 and mitad4 instead of mitad2 and different connection parameters.
Example code:
IF NOT CONNECTED("reportdb") THEN CONNECT reportdb .
FOR EACH RBREPORT:
DELETE RBREPORT.
END.
DO TRANSACTION:
CREATE RBREPORT.
ASSIGN RBREPORT.RB-REPORT-LIBRARY = "F:\practice\REPORTS.prl"
RBREPORT.RB-REPORT-NAME = "completa2"
RBREPORT.RB-DB-CONNECTION = "mitad1 = -db mitad3 -S 8888
~nmitad2 = -db mitad4 -S 8889 "
RBREPORT.RB-PRINT-DESTINATION = "A"
RBREPORT.RB-OUTPUT-FILE = "f:\practice\javier.txt"
RBREPORT.RB-DISPLAY-STATUS = yes
RBREPORT.RB-DISPLAY-ERRORS = yes.
RELEASE RBREPORT.
END.
/* Display report and delete record */
RUN aderb\_prore(false," -db reportdb -rbdel).