Four Js Development Tools Forum

Discussions by product => Reporting tools (GRW, GRE) => Topic started by: Jeff W. on October 22, 2010, 08:02:54 pm



Title: PDF file names
Post by: Jeff W. on October 22, 2010, 08:02:54 pm
To create PDF output I'm using the following reporting API functions.

CALL fgl_report_SelectDevice("PDF")
LET p_handler = fgl_report_commitCurrentSettings()
LET p_stat = fgl_report_RunReportFromProcessLevelDataFile(p_handler, p_filename)

The last function creates unique PDF file names such as:  Report-server-1335448-10-13-13-22-13.6.pdf

Is there a way to generate my own PDF file names?


Title: Re: PDF file names
Post by: Gary C. on October 23, 2010, 08:13:45 pm
Hi

I think you need to make a call to the function

fgl_report_setOutputFileName(fileName)



Title: Re: PDF file names
Post by: Jeff W. on October 26, 2010, 11:47:02 pm
Can you provide an example of how this fgl_report_setOutputFileName function is used?  I tried some different options, but no luck.  There's not a lot of documentation on it, other than it's suppose to be used with the fgl_report_selectPreview function.


Title: Re: PDF file names
Post by: Reuben B. on October 26, 2010, 11:57:54 pm
Can you provide an example of how this fgl_report_setOutputFileName function is used?  I tried some different options, but no luck.  There's not a lot of documentation on it, other than it's suppose to be used with the fgl_report_selectPreview function.

Using your code example, something like ...

Code
  1. CALL fgl_report_SelectDevice("PDF")
  2. CALL fgl_report_selectPreview(FALSE)
  3. CALL fgl_report_setOutputFileName("myname")
  4. LET p_handler = fgl_report_commitCurrentSettings()
  5. LET p_stat = fgl_report_RunReportFromProcessLevelDataFile(p_handler, p_filename)

... you should end up with myname.pdf



Title: Re: PDF file names
Post by: Jeff W. on October 27, 2010, 05:25:24 pm
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?


Title: Re: PDF file names
Post by: Jeff W. on October 27, 2010, 06:40:26 pm
After debugging and walking through the built-in functions (fgl_report_selectPreview, fgl_report_setOutputFileName, fgl_report_commitCurrentSettings), I understand what's happening now.


Title: Re: PDF file names
Post by: Reuben B. on October 27, 2010, 10:46:55 pm
After debugging and walking through the built-in functions (fgl_report_selectPreview, fgl_report_setOutputFileName, fgl_report_commitCurrentSettings), I understand what's happening now.

... out of curiousity what was the issue?


Title: Re: PDF file names
Post by: ORGA-SOFT B. on June 26, 2017, 03:52:48 pm
Hello Reuben,

i have exact the same problem.
I call the following functions
   IF  fgl_report_loadCurrentSettings("wagdrhesgrw.4rp") = TRUE THEN
        CALL fgl_report_selectDevice("PDF")
        CALL fgl_report_setOutputFileName("TEST.pdf")
        CALL fgl_report_commitCurrentSettings() RETURNING hdl   
   END IF

But the PDF is always generated with a random filename. So any suggestions what could be wrong?


 


Title: Re: PDF file names
Post by: Reuben B. on June 28, 2017, 02:18:34 am
Quote
Hello Reuben,

i have exact the same problem.
I call the following functions
   IF  fgl_report_loadCurrentSettings("wagdrhesgrw.4rp") = TRUE THEN
        CALL fgl_report_selectDevice("PDF")
        CALL fgl_report_setOutputFileName("TEST.pdf")
        CALL fgl_report_commitCurrentSettings() RETURNING hdl   
   END IF

But the PDF is always generated with a random filename. So any suggestions what could be wrong?

First guess is you are missing a line ... fgl_report_selectPreview(FALSE)



Title: Re: PDF file names
Post by: ORGA-SOFT B. on June 28, 2017, 11:07:04 am
Hello Reuben,

many thanks.
So if we want to bring up the pdf file with the preview param is set to true there is no way to set the filename of the pdf?