This didn't work. Here's what my code looks like.
LET p_stat = fgl_report_loadCurrentSettings("region_rpt.4rp")
CALL fgl_report_SelectDevice("PDF")
CALL fgl_report_selectPreview(FALSE)
CALL fgl_report_setOutputFileName("region")
LET p_handler = fgl_report_commitCurrentSettings()
LET p_stat = fgl_report_RunReportFromProcessLevelDataFile(p_handler, p_filename)
If I remove the call to function fgl_report_selectPreview, it works but I get a random PDF file name. Any other suggestions?