Kbase P6744: How to dynamically define the output directory of Report Bui
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  2/2/2003 |
|
Status: Unverified
GOAL:
How to dynamically assign Report Builder's rb-output-file at run time depending on the current user name or userid?
CAUSE:
Need to have Report Builder output to a file whose destination directory varies with the current user's database userid or the current user's operating system user name.
FIX:
1. If the database security is enforced, AND all user connections require a username and password login AND we need to use that database user name to determine the output directory then we code along the following lines:
DEFINE VARIABLE a AS CHARACTER NO-UNDO.
DEFINE VARIABLE b AS CHARACTER NO-UNDO.
DEFINE VARIABLE c AS CHARACTER NO-UNDO.
DEFINE VARIABLE d AS CHARACTER NO-UNDO.
DEFINE VARIABLE rb-output-file AS CHARACTER NO-UNDO.
ASSIGN
a = "C:\temp\"
b = USERID
c = "\t\"
d = "myfile.txt"
rb-output-file = a + b + c + d.
2. If the database security is NOT enforced, OR the users are allowed to connect using BLANK user ids, OR we need to use the OS level user name then we code along the following lines:
DEFINE VARIABLE a AS CHARACTER NO-UNDO.
DEFINE VARIABLE b AS CHARACTER NO-UNDO.
DEFINE VARIABLE c AS CHARACTER NO-UNDO.
DEFINE VARIABLE d AS CHARACTER NO-UNDO.
DEFINE VARIABLE rb-output-file AS CHARACTER NO-UNDO.
ASSIGN
a = "C:\temp\"
b = OS-GETENV('UserName')
c = "\t\"
d = "myfile.txt"
rb-output-file = a + b + c + d.