Consultor Eletrônico



Kbase P131111: Report Builder: How to Override the database connection string stored in a Report Builder's report?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   18/09/2009
Status: Verified

GOAL:

Report Builder: How to Override the database connection string stored in a Report Builder's report?

GOAL:

How to pass the Report Builder's RB-DB-CONNECTION parameter?

GOAL:

How to assign the Report Builder's RB-DB-CONNECTION parameter at run time?

GOAL:

How to change the database connection string for a Report Builder's report at run time?

FACT(s) (Environment):

All Supported Operating Systems
Progress 8.x
Progress 9.x
OpenEdge 10.x

FIX:

The following sample code demonstrates how to Override the database connection string stored in a Report Builder's report. It passes the desired new value of the RB-DB-CONNECTION to the Report Builder report engine parameter (_printrb interface):
DEFINE VARIABLE cDatabaseName AS CHARACTER NO-UNDO.
DEFINE VARIABLE cHostName AS CHARACTER NO-UNDO.
DEFINE VARIABLE cNetworkProto AS CHARACTER NO-UNDO.
DEFINE VARIABLE cPortNumber AS CHARACTER NO-UNDO.
DEFINE VARIABLE cOtherParams AS CHARACTER NO-UNDO.
DEFINE VARIABLE cNewConnString AS CHARACTER NO-UNDO.
DEFINE VARIABLE cDelimeter AS CHARACTER NO-UNDO.
ASSIGN
cDatabaseName = "Sports2000"
cHostName = "SomeHostName"
cNetworkProto = "tcp"
cPortNumber = "12345"
cOtherParams = "-mM 4096"
cDelimeter = CHR(32).
ASSIGN
cNewConnString =
"-db" + cDelimeter + cDatabaseName + cDelimeter +
"-H" + cDelimeter + cHostName + cDelimeter +
"-N" + cDelimeter + cNetworkProto + cDelimeter +
"-S" + cDelimeter + cPortNumber + cDelimeter +
cOtherParams.
RUN aderb/_printrb.p
("c:\work\reports.prl", /* RB-REPORT-LIBRARY */
"Customer List", /* RB-REPORT-NAME */
cNewConnString, /* RB-DB-CONNECTION */
"", /* RB-INCLUDE-RECORDS */
"" , /* RB-FILTER */
"", /* RB-MEMO-FILE */
"D", /* RB-PRINT-DESTINATION */
"", /* RB-PRINTER-NAME */
"", &nb.sp; /* RB-PRINTER-PORT */
"", /* RB-OUTPUT-FILE */
1, /* RB-NUMBER-COPIES */
0, /* no quotes */ /* RB-BEGIN-PAGE */
999, /* no quotes */ /* RB-END-PAGE */
no, /* RB-TEST-PATTERN */
"", /* RB-WINDOW-TITLE */
yes, /* RB-DISPLAY-ERRORS */
yes, /* RB-DISPLAY-STATUS */
no, /* RB-NO-WAIT */
"") /*RB-OTHER-PARAMETERS */.