I'm running some webfocus reports using PERL script The Perl script invokes the webfocus reports and download the file to my PC In the previous version of webfocus I used to download an EXCEL file and it worked fine Since version 5.3 the EXCEL file I'm trying to download is not readable by EXCEL (I have tried all EXCEL format) , It seems to contain a lot of HTML tag commands inside. Any idea how can create in webfocus an EXCEL file that is readable by EXCEL
June 15, 2008, 12:10 PM
FortuneCookie
If you're using EXCEL that format hasn't changed for years.
If you're using EXL2K, generally when the extension is .xls Excel would be able to interpret it properly. I believe the format that is being used is a xlshtml.
June 16, 2008, 08:41 AM
PBrightwell
Are you holding it ON TABLE HOLD FORMAT EXL2K? Are you sure that you don't have some other error and are not getting the report? Are you running this thru Developers Studio or MRE? Post your code (between
tags). Also, please update your signature to include the version and operating system.
Pat WF 7.6.8, AIX, AS400, NT AS400 FOCUS, AIX FOCUS, Oracle, DB2, JDE, Lotus Notes
June 16, 2008, 09:49 AM
ira
using aix 533 and wf 5.3.x - no problem dumping out to excel files on my end for a long time now. Can you post your code? Thanks, Ira
"market" is translated into fex script name called by perfapi, and passing it "MARKET=All FROMMONTH=200805 TOMONTH=200805 PREPAID=N FORM=EXL97" as follows:
my $response = $browser->get($url, ":content_file" => $filename );
"OUTPUT=..." the output filename (becomes "$filename").
(note: space in "http:// " included to block hyperlink generation.)
In the fex file, the report uses "FORM" as follows:
ON TABLE PCHOLD FORMAT &FORM ON TABLE SUMMARIZE ON TABLE SET STYLE * -INCLUDE stybc4.fex END -RUN
The excel output is generated successfully when the same fex is called by an html form, also passing the "FORM=" parameter.
Lastly, from the perl script, only EXL97 successfully returns HTML output. Other Excel formats return an empty file.This message has been edited. Last edited by: And,
Andrew
WF 53, HPUX 11.23
June 16, 2008, 06:16 PM
ehudba
We are using WebFOCUS 535 Server on HP-UX B.11.23 32on64 bit 9000/800/SD64A
The FEX file is generating EXCEL file in the following command
ON TABLE PCHOLD FORMAT &FORM
when form can be EXCEL or EXL2K or EXL97 When we are running it from HTML page the EXCEL file is generated correctly But when we are runing it from PERL program the file cant be read by EXCEL
This FEX is called by a PERL program
my $browser = LWP::UserAgent->new; my $url =URI ->new('http://dhtupgbl.tdc.cingular.net:9010/ibi_apps/WFServlet'); ... # ** hashv is has all the paramters we are passing to webfocus: parameter=value $url->query_form(%hashv);
# ** output sets to 1 if one of the parameter we pass is OUTPUT=filename
if ($output == 1) { my $response = $browser->get($url, ":content_file" => $filename ); die "$url error: ",$response->status_line unless $response->is_success; } else { my $response1 = $browser->get($url); die "$url error: ",$response1->status_line unless $response1->is_success; print $response1->content; }
When we run it with EXL97 we get an HTML file with XLS extension