Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: PDF file names  (Read 19469 times)
Jeff W.
Posts: 31


« 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?
Gary C.
Posts: 109


« Reply #1 on: October 23, 2010, 08:13:45 pm »

Hi

I think you need to make a call to the function

fgl_report_setOutputFileName(fileName)

Jeff W.
Posts: 31


« Reply #2 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.
Reuben B.
Four Js
Posts: 1119


« Reply #3 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


Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Jeff W.
Posts: 31


« Reply #4 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?
Jeff W.
Posts: 31


« Reply #5 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.
Reuben B.
Four Js
Posts: 1119


« Reply #6 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?

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
ORGA-SOFT B.
Posts: 34


« Reply #7 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?


 
Reuben B.
Four Js
Posts: 1119


« Reply #8 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)


Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
ORGA-SOFT B.
Posts: 34


« Reply #9 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?
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines