Focal Point
Saving Graph to GIF - GRAPHSERVURL and IBIGraphServlet
December 05, 2006, 05:55 AM
BHS6868Saving Graph to GIF - GRAPHSERVURL and IBIGraphServlet
Dear All,
I am having some difficulties saving graphs into GIF. I have tried everything mention in this forum, but still having the same problem. Hopefully someone here can help me.
Here is sample of a code:
FILEDEF SAVEFILE DISK C:\TEMPS\
SET GRAPHSERVURL=
http://webserver/ibi_apps/IBIGraphServletGRAPH FILE CAR
SUM SALES
ACROSS COUNTRY
ON GRAPH HOLD AS SAVEFILE FORMAT GIF
END
When I run the above code i get the following result in the webpage:
0 NUMBER OF RECORDS IN GRAPH= 18 PLOT POINTS= 5 FILE SAVEFILE.GIF SAVED TO C:\TEMPS
When I check the folder there is no gif file at all.
Curious i tried to run the following:
http://webserver/ibi_apps/IBIGraphServletand got this error:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.NullPointerException
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.What could be the problem??
Thanks in advance.
YJ
WebFOCUS 767 Server 64bit On Windows 2003 Server
WebFOCUS 767 Server for Developer Studio On windows XP
December 05, 2006, 06:17 AM
Tony AYJ,
It would be helpful to know what release and platform you are using. Add it to your signature in your profile so that it is shown each time you post.
On the GIF file, what C:\TEMPS did you check? Your local machine? If so then you need to understand how WebFOCUS HOLDs and SAVEs files (without wishing to "teach granny how to suck eggs").
When you issue a HOLD or SAVE the file gets written to a folder on the Reporting Server called EDATEMP with a subfolder called "tsnnnnnn" where the "nnnnnn" is a number relating to the agent that was used to execute the request on the server. With default environmental settings, the subfolders are "emptied" (with two exceptions) at the end of the request.
If you issue an APP HOLD [application folder name], then your files should be written to the folder [install directory]\IBI\APPS\[application folder name] on your reporting Server. Please note that there can be problems doing this with held data files (.mas files in particular) so use judiciously.
Alternatively, you can FILEDEF the file in advance of the HOLD to place the resultant file where you wish. Note that the FILEDEF will use a filepath relative to the machine that the Reporting Server is installed upon.
Try the following code and then look in the IBI\BASEAPP folder on your Reporting Server for the resultant GIF file, and you should see what I mean.
APP HOLD BASEAPP
GRAPH FILE CAR
SUM DCOST
RCOST
BY COUNTRY
ON GRAPH SET GRAPHEDIT OFF
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET GRID ON
ON GRAPH SET GRMERGE ON
ON GRAPH SET HAXIS 600
ON GRAPH SET VAXIS 400
ON GRAPH SET GRAPHSTYLE *
setCustomDataText(getY1Label(), true);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#,###,###");
-*setTextFormatPattern(getY1Label(),"#,###");
-*setDataTextFormat(1);
ENDSTYLE
ON TABLE HOLD AS mygif FORMAT GIF
END
Good luck
T
p.s. Forgot to mention that, because of your FILEDEF, you should be looking on your Reporting Server if you were not already.
In FOCUS since 1986 | WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2 | | |
WebFOCUS App Studio 8.2.06 standalone on Windows 10 | |
December 05, 2006, 08:00 AM
BHS6868Dear Tony A,
Firstly, thank you for replying to my question. I am actually very new to Webfocus.
I am currently running Webfocus version 7.1.1 on Windows 2003, IIS 6 as Webserver and Apache Tomcat 5.0 as application server.
I actually check the C:\TEMPS\ on the server drive but the gif files are not there. What I am concern is that there might be some settings issue that I have over look.
When I ran the Client Console, and did a diagnostic, the CGI settings failed. I can't remember the exact settings as I am not at the office at the moment.
Any advice?
Regards,
YJ
WebFOCUS 767 Server 64bit On Windows 2003 Server
WebFOCUS 767 Server for Developer Studio On windows XP
December 05, 2006, 08:52 AM
Tony AYJ,
Change your FILEDEF to FILEDEF SAVEFILE DISK C:\TEMPS\savedgif.gif and rerun. You should be able to locate your gif file then. When you FILEDEF something you need the filename as well as the path.
T
In FOCUS since 1986 | WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2 | | |
WebFOCUS App Studio 8.2.06 standalone on Windows 10 | |
December 05, 2006, 09:11 AM
RichHYJ,
First try commenting out the
ON GRAPH HOLD
line and see if it returns a graph to the screen.
IF it doesn't what error do you get?
IF it does, then check the GRAPH configuration under the WF admin console.
Rich
WebFOCUS 8202 Win 2012
Test - WebFOCUS 8203 on Win 2012
December 06, 2006, 01:05 AM
BHS6868Dear RichH,
Without the ON GRAPH HOLD, the graph is generated successfully.
I have check the GRAPH configuration and everything looks ok unless i miss something. I know there must be a configuration problem somewhere as when i am running
http://webserver/ibi_apps/IBIGraphServletI am getting a HTTP 500 error.
From other forums i have gathered that this is [B]not[\B] a normal error. I really have no idea what to do next as I am at a dead end.
Any help or advice would be greatly appreciated.
Regards,
Yue-Jeen
WebFOCUS 767 Server 64bit On Windows 2003 Server
WebFOCUS 767 Server for Developer Studio On windows XP
December 06, 2006, 04:08 AM
Tony AYue-Jeen,
Did you FILEDEF the filename as well as per my last post?
Running the link that you have posted will always fail as it is a servlet that requires input and you are not giving it any by running it as you are. It's like asking a child to go and get "one" without telling them what the "one" is or where from.
Try the full filedef and let us know the outcome.
T
In FOCUS since 1986 | WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2 | | |
WebFOCUS App Studio 8.2.06 standalone on Windows 10 | |
December 06, 2006, 08:23 AM
RichHHi Yue-Jeen,
Please try using the FILEDEF as Tony has suggested, but IF that fails, let us know what the settings are under the GRAPH configuration under the WF admin console.
Rich
WebFOCUS 8202 Win 2012
Test - WebFOCUS 8203 on Win 2012
December 06, 2006, 08:56 AM
<lfrerker>I just tackled this not too long ago. When using Apache Tomcat you cannot save it as a .gif, you have to save it as a svg. It's a problem with Apache Tomcat.
December 06, 2006, 09:12 AM
Tony AIfrerker,
You will note that my local platform is Apache / Tomcat and I have no problem in creating a gif file as above.
T
In FOCUS since 1986 | WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2 | | |
WebFOCUS App Studio 8.2.06 standalone on Windows 10 | |
December 06, 2006, 12:16 PM
N.SelphI would be interested in knowing what versions of Apache/Tomcat on what platform has the problem?
(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
December 06, 2006, 01:50 PM
<lfrerker>We are running Tomcat 5.0.28 on Linux with WF7.1.3. I followed the example straight from the book and kept getting an blank image, so I called our techrep and asked him about it and he advised me that Apache Tomcat had problems with creating the graph as a .gif and to use .svg, so I did and it worked.
January 11, 2007, 10:40 AM
KerryHi all,
FYI, one of our internal people running on Tomcat 5.028 ran the following graph request:
SET TEMPERASE = OFF
GRAPH FILE CAR
SUM SALES
BY COUNTRY
ON GRAPH HOLD AS TEST FORMAT GIF
END
TABLE FILE CAR
PRINT CAR NOPRINT
ON TABLE SET STYLE *
TYPE=REPORT, IMAGE=TEST.GIF,$
ENDSTYLE
ON TABLE PCHOLD FORMAT PDF
END
And it displayed perfectly, no problem in generating .gif with that version of Tomcat.
To pursue further and/or re-open the ticket, please contact Information Builders' Customer Support Services for further assistance/information. You may either call at 1-800-736-6130, or access online at
InfoResponse.
Hope this helps.
Cheers,
Kerry
Kerry Zhan
Focal Point Moderator
Information Builders, Inc.