Focal Point
[CLOSED] Saving the oupt of a fex file on the client Machine

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

March 28, 2012, 07:33 AM
Majid Jeddi
[CLOSED] Saving the oupt of a fex file on the client Machine
Hi,

I have created a report that output in DBASE format. The issue is that the file is created on the server instead of the client machine.
Can somebody help me find out how to do that.

Thanks in advance.

This message has been edited. Last edited by: Kerry,


WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server
March 28, 2012, 10:03 AM
ABT
Try ON TABLE PCHOLD if the file will be interactively created or FILEDEF if the file is to be automatically created.

- ABT

quote:
Originally posted by Majid Jeddi:
Hi,

I have created a report that output in DBASE format. The issue is that the file is created on the server instead of the client machine.
Can somebody help me find out how to do that.

Thanks in advance.



------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
March 28, 2012, 12:07 PM
Danny-SRL
You cannot PCHOLD a DBASE file.
What you can do is FTP it from the server to your machine.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

March 28, 2012, 04:33 PM
Waz
Something that I did many years ago, was to write the output to the users network home drive, perhaps you could do this ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

March 29, 2012, 09:02 AM
Majid Jeddi
Hi

Thanks to all of you for your suggestions.

The issue is that the users running the report are not part of my network.

Regards.


WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server
March 29, 2012, 12:04 PM
TexasStingray
An option if your WebFOCUS Client and Reporting Server are on the same box would be to have the WebFOCUS procedure create the file into a folder that woudl be accessable from the Web Server (there is usually a approot alias defined on the web server) say an output folder. Then use a script to create a zip file with the DBASE file inside of it. At the end of the webfocus procedure send the use back an html file with a link to there zip file. You'll want to be sure that each zip file and DBASE file are unique. And you will want to also perform some type of cleanup on that folder to delete the old DBASE files and Zip files.




Scott

You can PCHOLD the dbase file, with some extra code.
TABLE FILE CAR
PRINT COUNTRY
ON TABLE HOLD FORMAT DBASE
END
-RUN
! DIR
FILEDEF DBF DISK hold.dbf
-RUN
SET HTMLFORMTYPE = DBASE
-HTMLFORM DBF


You will still have to set up mime types in the admin console.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

Hi Waz,

I have edited the file mime but could not find an entry for DBASE.
I could not run this example successfully.

Regards


WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server
Hi Waz

i have edited the file mime on the server and prior to that i made a copy of it and added a line for DBASE.
i went after the console and could see the changes i did. But this does not have any effect on the example you sent.
Any other thing to check?

Thanks

Majid.



quote:
Originally posted by Waz:
You can PCHOLD the dbase file, with some extra code.
TABLE FILE CAR
PRINT COUNTRY
ON TABLE HOLD FORMAT DBASE
END
-RUN
! DIR
FILEDEF DBF DISK hold.dbf
-RUN
SET HTMLFORMTYPE = DBASE
-HTMLFORM DBF


You will still have to set up mime types in the admin console.



WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server
Is there an equivalent assiciation in Windows ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

Hi Waz,

Yes dbf files are associated with dbx.exe. This is the software that we use to open dbf files.

Regards.


WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server
Where did you change the mime settings ?

Did you bounce the web app server?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

Hi Waz,

There is a mime file on the server. I look at it and saw how it was built then i duplicate on of the lines and adjusted it to DBASE.

Note: Prior to that i made a backup of the original file.

Regards.


WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server
Where is the mime file, what app does it belong to ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

It is in this directory on the server

D:\ibi\WebFOCUS77\client\wfc\etc

Regards.


WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server
You're at the limits of my knowledge. I would have thought that this would work.

I would suggest talking to Techsupport.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

Hi Waz,

Thanks in way. Your Idea would be perfect for me if it worked.

Regards.


WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server
What if...

You HOLD the file in a directory that your web server would have access to then build a URL that points to the file you just created?

We do something like that when retrieving PDF documents that are stored in a SQLMSS table as blobs.

Step one - assign a random name to the file and create the URL:
-DEFAULTH &TMP_EXT = 'pdf' ;
-SET &TMP_RAND2 = RDUNIF('D12.8') * 26;
-SET &TMP_RAND3 = RDUNIF('D12.8') * 26;
-SET &TMP_RNDALPH1 = DECODE &TMP_RAND2(0 'Z' 1 'A' 2 'B' 3 'C' 4 'D' 5 'E' 6 'F' 7 'G' 8 'H' 9 'I' 10 'J' 11 'K' 12 'L' 13 'M' 14 'N' 15 'O' 16 'P' 17 'Q' 18 'R' 19 'S' 20 'T' 21 'U' 22 'V' 23 'W' 24 'X' 25 'Y' 26 'Z');
-SET &TMP_RNDALPH2 = DECODE &TMP_RAND3(0 'Z' 1 'A' 2 'B' 3 'C' 4 'D' 5 'E' 6 'F' 7 'G' 8 'H' 9 'I' 10 'J' 11 'K' 12 'L' 13 'M' 14 'N' 15 'O' 16 'P' 17 'Q' 18 'R' 19 'S' 20 'T' 21 'U' 22 'V' 23 'W' 24 'X' 25 'Y' 26 'Z');
-SET &TMP_RAND = RDUNIF('D14.12') * 100000000;
-SET &TMP_RANDNAME = &TMP_RNDALPH1 | &TMP_RNDALPH2 |&TMP_RAND | '.' | &TMP_EXT;
-SET &TMP_RANDPATH = '[..]\ibi\ibitmp\' | &TMP_RANDNAME ;
-SET &TMP_RANDURL = 'https://[hostname]/ibitmp/' | &TMP_RANDNAME ;  

Note: I replaced some path-specific code with [..]
You don't have to randomize the file name. We do it to eliminate the possibility of file saving 'collisions'

We are running Tomcat as our web server so we had to create a context document that points to the directory [..]/ibi/ibitmp
[..]\ibi\tomcat\conf\Catalina\localhost\ibitmp.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context
    cachingAllowed="false"
    docBase="[..]\ibi\ibitmp">
</Context>  



Step two - open the URL:
-HTMLFORM BEGIN
<HTML>
<IFRAME id=iframe1 SRC="!IBI.AMP.TMP_RANDURL;" height=100% width=100%>
</HTML>
-HTMLFORM END
  

If the user has a mime type set then the file should open. Otherwise it should prompt them to save it.

Lastly, I put a scheduled batch file on the server to delete the contents of the ibitmp directory some time during the night.

Regards,

Dan


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
Hello everybody,

just a quick hint on the HTMLFORM solution: Please be aware that WF (at least still in my 7.7.01 ver) performs some changes to the data stream provided in a HOLD file when "putting it out" using -HTMLFORM.

quote:
SET HTMLFORMTYPE = DBASE
-HTMLFORM DBF


Btw.: In an MRE env. you might also want to add a -mrnoedit before the -HTMLFORM.


At least for me, this does not work for all binary files like PDF. I do not know the structure of DBASE files but if they contain binary code this might be true here, too.
I believe -HTMLFORM interprets all data provided as "text with \n and a max. line length". Binary data as PDF files might not be returned "byte-exact" as the input was.

(E.g. tried with static PDF "WebFOCUS Special Newsletter Dec 2010" - did not work)


Therefore you might want to opt for the solution Dan proposed or you could wrap a base64 encoded version of your hold file (e.g. using powershell or java helper class) into an MHT file and use
SET HTMLFORMTYPE=MHT
-HTMLFORM MHT_HOLD


Cheers Linne


WebFOCUS 7.7.03