Kbase P122890: Report Builder fails to export report if there is a space in the RB-OUTPUT-FILE path
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  19/03/2007 |
|
Status: Unverified
SYMPTOM(s):
Report Builder
Attempting to export a report to a file
Error occurs if the file path contains a space
Invalid file name in RB-OUTPUT-FILE
File is generated correctly if there are no spaces in the path
CAUSE:
The RB-OUTPUT-FILE parameter can only accept the 16-bit file format. The parameter therefore does not support long file names or file names containing blank spaces.
As Report Builder is now a Mature product, no further bug fixes, enhancements or add-ons will be provided so this behaviour will not change.
FIX:
Option #1
Use the Win32 API function GetShortPathName to convert a 32-bit path to 16-bit format. Refer to solution P122893 for more information on the GetShortPathName API.
Option #2
Handle the paths manually or via a 4GL conversion routine. If the file to create is: c:\Program files\Reports\myReport.txt, the field name variable should be:
DEFINE VARIABLE cFileName AS CHARACTER NO-UNDO.
cFileName = "c:\Progra" + CHR(126) + "1\Reports\myReport.txt".
If the file to create is .\My reports\myReport.txt, the field variable name should be:
DEFINE VARIABLE cFileName AS CHARACTER NO-UNDO.
cFileName = "c:\MyRepo" + CHR(126) + "1\Reports\myReport.txt".
The field name stored in the variable should be used in the RB-OUTPUT-FILE parameter as shown in this example:
RUN aderb/_printrb.p
("reports.prl", /* RB-REPORT-LIBRARY */
"customer", /* RB-REPORT-NAME */
"", /* RB-DB-CONNECTION */
"", /* RB-INCLUDE-RECORDS */
"", /* RB-FILTER */
"", /* RB-MEMO-FILE */
"A", /* RB-PRINT-DESTINATION */
"", /* RB-PRINTER-NAME */
"", /* RB-PRINTER-PORT */
"cFileName", /* RB-OUTPUT-FILE */
1, /* RB-NUMBER-COPIES */
1, /* RB-BEGIN-PAGE */
99999, /* RB-END-PAGE &nbs.p; */
no, /* RB-TEST-PATTERN */
"", /* RB-WINDOW-TITLE */
yes, /* RB-DISPLAY-ERRORS */
yes, /* RB-DISPLAY-STATUS */
no, /* RB-NO-WAIT */
""). /* RB-OTHER-PARAMETERS */
Option #3
Ensure that users can only export reports to specific locations/paths that do not contain spaces..