Focal Point
How to send a file to specific folder on my hard drive

This topic can be found at:
http://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3111006332

June 21, 2007, 11:11 AM
tlbrydie2
How to send a file to specific folder on my hard drive
I am testing a POC. I am writing a fex that produces a PDF (ON TABLE PCHOLD FORMAT PDF).

I want save the pdf produced in a specific file on my hard drive (ie. C:\temp\car.pdf). I want to then be able to open the file up with ADOBE and see the pdf that was created.

Could someone offer assistance with this.

Thanks.




Prod: WebFOCUS 7.6.10 MRE
Oracle/Sybase
Test: DevStudio 7.6.6
WF Server 7.6.6
Report Caster 7.6.6
Web Server - Tomcat
MS Windows XP SP2
Output: HTML, Excel 2000 , PDF, CSV, DOC

June 21, 2007, 11:20 AM
Prarie
first Filedef the output where you want it to go.

FILEDEF VPDOC DISK \\velo\iscsc$\reports\vpdoc.pdf

Then Hold your ouput of the report

ON TABLE HOLD FORMAT PDF AS VPDOC


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
quote:
FILEDEF VPDOC DISK \\velo\iscsc$\reports\vpdoc.pdf


Hi Prarie.

I've tried both on table "save" and "pchold" and when I look at temp1 the TLBPOC01.pdf file is not there.
-* File timpoc.fex
-*FILEDEF TLBPOC DISK C:\TEMP1\TLBPOCTEST
FILEDEF TLBPOC1 DISK \\TEMP1\TLBPOC01.PDF

TABLE FILE BE_MERCHANT
PRINT
BANK_NUMBER
MERCHANT
MERCHANT_NAM
PHONE_NUM
MERCHANT_LEGAL_NAM
HEADING
"This is a test report "
WHERE BANK_NUMBER EQ '1922';
WHERE RECORDLIMIT EQ 10
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE SAVE FORMAT PDF
-*ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
COLOR='BLACK',
BACKCOLOR='NONE',
STYLE=NORMAL,
$
ENDSTYLE
END




Prod: WebFOCUS 7.6.10 MRE
Oracle/Sybase
Test: DevStudio 7.6.6
WF Server 7.6.6
Report Caster 7.6.6
Web Server - Tomcat
MS Windows XP SP2
Output: HTML, Excel 2000 , PDF, CSV, DOC

ON the Hold you have to tell it the name.

FORMAT PDF AS TLBPOC1


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
this is my latest...still no file on my hard drive

FILEDEF TLBPOC1 DISK \\TEMP1\tlbpoc01.pdf

TABLE FILE BE_MERCHANT
PRINT
BANK_NUMBER
MERCHANT
MERCHANT_NAM
PHONE_NUM
MERCHANT_LEGAL_NAM
HEADING
"This is a test report "
WHERE BANK_NUMBER EQ '1922';
WHERE RECORDLIMIT EQ 10
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE HOLD FORMAT PDF AS TLBPOC1
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
COLOR='BLACK',
BACKCOLOR='NONE',
STYLE=NORMAL,
$
ENDSTYLE
END




Prod: WebFOCUS 7.6.10 MRE
Oracle/Sybase
Test: DevStudio 7.6.6
WF Server 7.6.6
Report Caster 7.6.6
Web Server - Tomcat
MS Windows XP SP2
Output: HTML, Excel 2000 , PDF, CSV, DOC

try putting a -RUN after the filedef. On a related note, why not just let WF perform the default functionality (ON TABLE SET ONLINE_FMT PDF) . It opens in the Acrobat viewer so you can see it. You can save it from there to wherever you want so you can play with it further.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
Hi Darin,

I included the -RUN still no file on my hard drive. The POC is to see if I can hold a Webfocus created PDF to a file and another user (who does not have WF) can open that file and fiew the PDF. This is why I'm not holding as pdf. I'm using my box to test this concept.




Prod: WebFOCUS 7.6.10 MRE
Oracle/Sybase
Test: DevStudio 7.6.6
WF Server 7.6.6
Report Caster 7.6.6
Web Server - Tomcat
MS Windows XP SP2
Output: HTML, Excel 2000 , PDF, CSV, DOC

Please also remember that the PDF file is created on the machine where the WebFOCUS Server is installed. It will not be able to put the file onto a directory that is on your desktop computer.

For your FILEDEF to work, the machine on which the WebFOCUS server is installed must be able to recognize the directory. Is the WebFOCUS server machine able to access the \\TEMP1 directory?


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
You can also so as Darin stated:

Use the ON TABLE PCHOLD FORMAT PDF statement. This tells WebFOCUS to send the PDF document to your browser. your browser will then recignize the .PDF extension and start the Adobe Reader for you.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
No the WF server cannot see my box. Is their no way to create a .pdf file on any file I'm able to write to on the network and someone can just open that file up with adobe?




Prod: WebFOCUS 7.6.10 MRE
Oracle/Sybase
Test: DevStudio 7.6.6
WF Server 7.6.6
Report Caster 7.6.6
Web Server - Tomcat
MS Windows XP SP2
Output: HTML, Excel 2000 , PDF, CSV, DOC

Guess I was not understanding the question all the way. There isn't a way to "automagically" run and hold the PDF file on an external box. The ON TABLE PCHOLD would send it back to a browser and the user can then save to wherever they want and another user could access it.
That being said, here's a way around that. If the WF server has access to network drives (you may want to have a mapped drive as it may be less confusing) you could create a directory mapping on the WF server (say HOLDPDF that points to network drive N: or \\servername\users\PDFrpts) and add it to the server path. If you then do APP HOLD HOLDPDF and use ON TABLE HOLD AS TLBPOC1 FORMAT PDF in your fex, it should create the file on the network drive that can be accessed by other users.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
Thanks Darin, I'll give this suggestion a try. Essentially I will need to do this even if I'm writing to my box... correct?




Prod: WebFOCUS 7.6.10 MRE
Oracle/Sybase
Test: DevStudio 7.6.6
WF Server 7.6.6
Report Caster 7.6.6
Web Server - Tomcat
MS Windows XP SP2
Output: HTML, Excel 2000 , PDF, CSV, DOC

tlbrydie2,

You need to remember that the PDF document created can only be written to directories which the WebFOCUS server has access to. If you really need it to be written to YOUR machine then you will need to share a directory on your machine with the network and then map a network drive (as Darrin stated) on the WebFOCUS server to point to the shared directory on your machine. You then need to do two things:

1) Add an application directory mapping to the APP PATH for the HOLDPDF. Do this by adding the following statement to your focexec:

APP MAP HOLDPDF mapped_network_drive_name

2) Add the following statement to your focexec:

APP FI TLBPOC1 DISK HOLDPDF/tlbpoc1.pdf


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
Thanks,

Prarie, Mgrackin, Daren




Prod: WebFOCUS 7.6.10 MRE
Oracle/Sybase
Test: DevStudio 7.6.6
WF Server 7.6.6
Report Caster 7.6.6
Web Server - Tomcat
MS Windows XP SP2
Output: HTML, Excel 2000 , PDF, CSV, DOC

Good Luck...


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Well...I created a new folder and put it in the app path...the .pdf gets created successfully in that file with this code.
APP FI TLBPOC1 DISK POC/tlbpo1.pdf
-*FILEDEF TLBPOC1 DISK \\TEMP1\tlbpoc01.pdf
-RUN
TABLE FILE BE_MERCHANT
PRINT
BANK_NUMBER
MERCHANT
MERCHANT_NAM
PHONE_NUM
MERCHANT_LEGAL_NAM
HEADING
"This is a test report "
WHERE BANK_NUMBER EQ '1922';
WHERE RECORDLIMIT EQ 10
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE SAVE FORMAT PDF AS TLBPOC1
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
COLOR='BLACK',
BACKCOLOR='NONE',
STYLE=NORMAL,
$
ENDSTYLE
END

but comes out looking like this :

%PDF-1.4
6 0 obj
<<
/Length 7 0 R
>>
stream
BT /F1 1 Tf ET
0 g
/GS1 gs
0 Tc
0 Tw
0 G
0 J 0 j 1 w 10 M []0 d
1 i
BT /F2 1 Tf 10 0 0 10 18 754 Tm (This is a test report )Tj
10 0 0 10 18 744 Tm (BANK_NUMBER)Tj 10 0 0 10 108 744 Tm (MERCHANT)Tj 10 0 0 10 202 744 Tm (MERCHANT_NAM)Tj 10 0 0 10 356 744 Tm (PHONE_NUM)Tj 10 0 0 10 431 744 Tm (MERCHANT_LEGAL_NAM)Tj
ET 0.00 0.00 0.00 RG 18 738 m 94 738 l S 108 738 m 164 738 l S 202 738 m 286 738 l S 356 738 m 417 738 l S 431 738 m 553 738 l S
BT 10 0 0 10 18 722 Tm (1922)Tj 10 0 0 10 108 722 Tm (4301322110924210)Tj 10 0 0 10 202 722 Tm (GIANTS TKT SP TRAINING)Tj 10 0 0 10 356 722 Tm (4153302458)Tj 10 0 0 10 431 722 Tm (GIANTS TKT SP TRAINING)Tj
10 0 0 10 18 712 Tm (1922)Tj 10 0 0 10 108 712 Tm (4301322110926488)Tj 10 0 0 10 202 712 Tm (SF GIANTS TICKET OFF 2)Tj 10 0 0 10 356 712 Tm (6503239790)Tj 10 0 0 10 431 712 Tm (SF GIANTS TICKET OFF 2)Tj
10 0 0 10 18 702 Tm (1922)Tj 10 0 0 10 108 702 Tm (4301322110926496)Tj 10 0 0 10 202 702 Tm (SF GIANTS TICKET OFF 3)Tj 10 0 0 10 356 702 Tm (6507557571)Tj 10 0 0 10 431 702 Tm (SF GIANTS TICKET OFF 3)Tj
10 0 0 10 18 692 Tm (1922)Tj 10 0 0 10 108 692 Tm (4301322110926504)Tj 10 0 0 10 202 692 Tm (SF GIANTS TICKET 4)Tj 10 0 0 10 356 692 Tm (4082475580)Tj 10 0 0 10 431 692 Tm (SF GIANTS TICKETT 4)Tj
10 0 0 10 18 682 Tm (1922)Tj 10 0 0 10 108 682 Tm (4301322110926512)Tj 10 0 0 10 202 682 Tm (SF GIANTS TICKET DUGOUT 5)Tj 10 0 0 10 356 682 Tm (4152423222)Tj 10 0 0 10 431 682 Tm (SF GIANTS TICKET DUGOUT 5)Tj
10 0 0 10 18 672 Tm (1922)Tj 10 0 0 10 108 672 Tm (4301322110926538)Tj 10 0 0 10 202 672 Tm (GIANTS LOWER TICKET OFF)Tj 10 0 0 10 356 672 Tm (4153302458)Tj 10 0 0 10 431 672 Tm (GIANTS LOWER TICKET OFF)Tj
10 0 0 10 18 662 Tm (1922)Tj 10 0 0 10 108 662 Tm (4301322110926546)Tj 10 0 0 10 202 662 Tm (SF GIANTS DAY OF GAME)Tj 10 0 0 10 356 662 Tm (4153302458)Tj 10 0 0 10 431 662 Tm (SF GIANTS DAY OF GAME)Tj
10 0 0 10 18 652 Tm (1922)Tj 10 0 0 10 108 652 Tm (4301322110939143)Tj 10 0 0 10 202 652 Tm (PEET'S COFFEE AND TEA 229)Tj 10 0 0 10 356 652 Tm (4155656713)Tj 10 0 0 10 431 652 Tm (PEET'S COFFEE AND TEA 229)Tj
10 0 0 10 18 642 Tm (1922)Tj 10 0 0 10 108 642 Tm (4301322110976962)Tj 10 0 0 10 202 642 Tm (PEET'S COFFEE AND TEA 214)Tj 10 0 0 10 356 642 Tm (9259332718)Tj 10 0 0 10 431 642 Tm (PEET'S COFFEE AND TEA 214)Tj
10 0 0 10 18 632 Tm (1922)Tj 10 0 0 10 108 632 Tm (4301322110987480)Tj 10 0 0 10 202 632 Tm (PEET'S COFFEE AND TEA 215)Tj 10 0 0 10 356 632 Tm (5106537876)Tj 10 0 0 10 431 632 Tm (PEET'S COFFEE AND TEA 215)Tj
ET endstream
endobj
7 0 obj
2518
endobj
8 0 obj << /Type /Page /Parent 5 0 R /Resources 4 0 R /Contents 6 0 R >> endobj
4 0 obj
<<
/ProcSet [/PDF /Text /ImageC]
/Font <<
/F1 9 0 R
/F2 10 0 R
>>
/XObject <<
>>
/ExtGState <<
/GS1 2 0 R
>>
>>
endobj
5 0 obj
<<
/Types /Pages
/Kids [8 0 R ]
/Count 1
/MediaBox [0 0 612 792]
>>
endobj
9 0 obj
<<
/Type /Font
/Subtype /Type1
/Encoding /WinAnsiEncoding
/Name /F1
/BaseFont /Courier
>>
endobj
10 0 obj
<<
/Type /Font
/Subtype /Type1
/Encoding /WinAnsiEncoding
/Name /F2
/BaseFont /Times-Roman
>>
endobj
3 0 obj
<<
/Type /Halftone
/HalftoneType 1
/HalftoneName (Default)
/Frequency 60
/Angle 45
/SpotFunction /Round
>>
endobj
2 0 obj
<<
/Type /ExtGState
/SA false
/OP false
/HT /Default
>>
endobj
1 0 obj
<<
/Type /Catalog
/Pages 5 0 R
>>
endobj
xref
0 11
0000000000 65535 f
0000003370 00000 n
0000003291 00000 n
0000003159 00000 n
0000002691 00000 n
0000002832 00000 n
0000000010 00000 n
0000002587 00000 n
0000002610 00000 n
0000002926 00000 n
0000003040 00000 n
trailer
<<
/Size 11
/Root 1 0 R
>>
startxref
3425
%%EOF




Prod: WebFOCUS 7.6.10 MRE
Oracle/Sybase
Test: DevStudio 7.6.6
WF Server 7.6.6
Report Caster 7.6.6
Web Server - Tomcat
MS Windows XP SP2
Output: HTML, Excel 2000 , PDF, CSV, DOC

Please disregard previous post. File was created correctly. I needed to ftp the file as binary




Prod: WebFOCUS 7.6.10 MRE
Oracle/Sybase
Test: DevStudio 7.6.6
WF Server 7.6.6
Report Caster 7.6.6
Web Server - Tomcat
MS Windows XP SP2
Output: HTML, Excel 2000 , PDF, CSV, DOC