Charts not displayed [message #217064] |
Tue, 06 February 2007 11:49 |
Eclipse User |
|
|
|
Originally posted by: matteo.rocco.icona.it
When I am deploying reports using Tomcat, all works fine if my report
include a table. If I also put a chart inside.. nothing is displayed
Am I doing something wrong? Missing some configuration parameters?
Thanks
Matteo
Linux
Tomcat 4.1.31
birt-runtime 2.1.0
|
|
|
|
Re: Charts not displayed (Please help) [message #217189 is a reply to message #217158] |
Tue, 06 February 2007 18:48 |
Eclipse User |
|
|
|
Originally posted by: mayous2004.yahoo.com
Hi,
I tried several things related to this issue. I have deployed a report
with a pie chart and deployed the same on Tomcat (Windows). When I tried
to access that report I always run into this issue
"java.lang.noclassDefFoundError"
I researched the FAQ and search engines and realized that I need to add
-Djava.awt.headless=true to Tomcat - Java JVM Options.
Restarted the Tomcat .
Still no luck.
I would really appreciate if someone who resolved this kind of issue can
throw some light.
Looking forward to hear from the experts.
|
|
|
|
Re: Charts not displayed (Please help) [message #217266 is a reply to message #217227] |
Wed, 07 February 2007 01:05 |
Eclipse User |
|
|
|
Originally posted by: mayous2004.yahoo.com
Thanks for following up.
As such I dont see any stack trace in Tomcat/Logs. Is there any other
place I should be looking for. All I get a exception message: Java
ClassCastException: NoClassDefFoundException.
I looked at Tomcat Logs and they look pretty clean.
Another thing I noticed was if I run the report using localhost it runs
without any issues.
If I try to run the report from a remote machine then I get the above
exception.
Thanks
RG
|
|
|
|
|
Re: Charts not displayed [message #217359 is a reply to message #217158] |
Wed, 07 February 2007 11:37 |
Eclipse User |
|
|
|
Originally posted by: matteo.rocco.icona.it
with option -Djava.awt.headless=true the report display the table but
not the chart :-(
I have also tried with birt-runtime-2_2_0 and Tomcat 5.5.20
The some configuration on Windows works fine
> Did you check this entry in the FAQ:
> http://wiki.eclipse.org/index.php/BIRT/FAQ/Charts2.1#Charts_ not_rendering_on_Unix_systems
>
>
> Thanks,
>
> David
>
>> When I am deploying reports using Tomcat, all works fine if my report
>> include a table. If I also put a chart inside.. nothing is displayed
>>
>> Am I doing something wrong? Missing some configuration parameters?
>>
>> Thanks
>>
>> Matteo
>>
>> Linux
>> Tomcat 4.1.31
>> birt-runtime 2.1.0
>
>
|
|
|
|
|
Re: Charts not displayed [message #217422 is a reply to message #217399] |
Wed, 07 February 2007 14:40 |
Eclipse User |
|
|
|
Originally posted by: matteo.rocco.icona.it
On Windows I don't use headless parameters.
JDK is both 1.4.2_08 Windows and Linux
On Linux I set headless parameters in catalina.sh:
"$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
-Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
-Dcatalina.base="$CATALINA_BASE" \
-Dcatalina.home="$CATALINA_HOME" \
-Djava.io.tmpdir="$CATALINA_TMPDIR" \
-Djava.awt.headless=true \
org.apache.catalina.startup.Bootstrap "$@" start \
>> "$CATALINA_BASE"/logs/catalina.out 2>&1 &
I have also tried with jre 1.5, it show table without headless parameter
but don't show chart :-(
Thanks,
Matteo
David Michonneau ha scritto:
> If the exact same configuration works on Windows, it has to be this
> problem. Where did you set the headless parameter? What JDK are you
> using? I recommend JDK 1.4, but maybe you could try with JDK 5.0 (to
> test that problem), which doesn't even need the headless parameter.
>
> Thanks,
>
> David
>
>
>
>> with option -Djava.awt.headless=true the report display the table but
>> not the chart :-(
>>
>> I have also tried with birt-runtime-2_2_0 and Tomcat 5.5.20
>>
>> The some configuration on Windows works fine
>>
>>> Did you check this entry in the FAQ:
>>> http://wiki.eclipse.org/index.php/BIRT/FAQ/Charts2.1#Charts_ not_rende
>>> ring_on_Unix_systems
>>>
>>> Thanks,
>>>
>>> David
>>>
>>>> When I am deploying reports using Tomcat, all works fine if my
>>>> report include a table. If I also put a chart inside.. nothing is
>>>> displayed
>>>>
>>>> Am I doing something wrong? Missing some configuration parameters?
>>>>
>>>> Thanks
>>>>
>>>> Matteo
>>>>
>>>> Linux
>>>> Tomcat 4.1.31
>>>> birt-runtime 2.1.0
>
>
|
|
|
|
Re: Charts not displayed [message #217463 is a reply to message #217452] |
Wed, 07 February 2007 15:53 |
Eclipse User |
|
|
|
Originally posted by: matteo.rocco.icona.it
I am a newbie and I don't understand where should I put the code below
as I've been using birt for just couple days :)
I saw now that birt saves images in following directory:
webapps/birt-viewer/report/images
There are images like custom21.png which are exactly the graphs it
should display in the browser.
Also it always creates .png image even if I ask him to create jpg, svg
or something else..
Thanks
Matteo
Erica Jackson ha scritto:
> I seem to remember having a similar issue and it had to do with where
> the images were being saved on the server. I had to use the
> HTMLEmitterConfig to set the imageHandler to a ServerImageHandler.
> Here is the code I use to render an HTML report. I don't think I had
> this problem with a PDF report.
> EngineConfig engineConfig = new EngineConfig();
>
> String engineHome =
> Thread.currentThread().getContextClassLoader().getResource("org/eclipse/birt/report/engine/api/EngineConfig.class ").getPath();
> engineHome = engineHome.substring(6, engineHome.indexOf("engineapi.jar"));
> engineHome = engineHome.replaceAll("\\%20", " ");
>
> engineConfig.setEngineHome(engineHome);
>
> IReportEngine engine;
> PlatformConfig pConfig = new PlatformConfig();
> IPlatformContext context = new
> PlatformServletContext(request.getSession().getServletContex t());
> pConfig.setPlatformContext(context);
>
> Platform.startup(pConfig);
>
> IReportEngineFactory factory = (IReportEngineFactory)
>
> Platform.createFactoryObject(IReportEngineFactory.EXTENSION_ REPORT_ENGINE_FACTORY);
>
>
> RenderOptionBase options = null;
> HashMap map = new HashMap();
>
> // Create the emitter configuration.
> HTMLEmitterConfig hc = new HTMLEmitterConfig( );
>
> // Use the "HTML complete" image handler to write the files to disk.
> HTMLServerImageHandler imageHandler = new HTMLServerImageHandler( );
> hc.setImageHandler( imageHandler );
>
> // Associate the configuration with the HTML output format.
> engineConfig.setEmitterConfiguration(
> HTMLRenderOption.OUTPUT_FORMAT_HTML, hc );
>
> String userSession = request.getSession().getId();
> String hostName = "http://" + request.getServerName() + ":" +
> request.getServerPort();
>
> HTMLRenderContext ctx = new HTMLRenderContext();
> ctx.setImageDirectory("../webapps/appname/reportimages/" + userSession);
> ctx.setBaseImageURL(hostName + "/appname/reportimages/" + userSession);
> map.put(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT, ctx);
>
> options = new HTMLRenderOption();
> options.setOutputFormat("html");
>
> options.setOutputStream(response.getOutputStream());
>
> engine = factory.createReportEngine(engineConfig);
>
>
> // Open a report design - use design to modify design, retrieve embedded
> // images etc.
> InputStream reportStream =
> Thread.currentThread().getContextClassLoader().getResourceAs Stream(reportFileName);
> IReportRunnable design = engine.openReportDesign(reportStream);
>
> // Create task to run the report - use the task to execute and run the
> // report
> IRunAndRenderTask task = engine.createRunAndRenderTask(design);
>
> task.setRenderOption(options);
> task.setAppContext(map);
>
> // run the report and destroy the engine
> task.run();
>
|
|
|
|
Re: Charts not displayed [message #217730 is a reply to message #217488] |
Thu, 08 February 2007 07:50 |
Eclipse User |
|
|
|
Originally posted by: matteo.rocco.icona.it
Erica Jackson ha scritto:
> I understand being a newbie. I was once one as well. Actually, I still
> am when it comes to some things. :)
>
> This code uses the Report Engine API to generate a report and stream it
> back to the user. You would put this code into your own servlet in your
> own web application. I don't think you would be able to use BIRT's Web
> Viewer Example with this code.
I'm using birt with php
> After the report generates in HTML, could you right click on the page
> and view the source to see if the image URL matches the location where
> the image is actually stored?
I saw now, thanks to Firefox plug-in, the HTML code for images:
<div>
<img id="AUTOGENBOOKMARK_11" element_type="EXTENDED" iid="/72(QuRs6:0)"
src="/birt-viewer/run?__imageID=custom1.png" alt="" style=" width:
5.906in; height: 2.666in;">
</div>
Could it be a wrong cofiguration parameter? :-(
>
>
> Have you tried generating the report in PDF format? Does the chart
> appear with that format?
Yesss!!
Thanks,
Matteo
|
|
|
|
|
|
|
Re: Charts not displayed [message #217919 is a reply to message #217810] |
Thu, 08 February 2007 17:15 |
Eclipse User |
|
|
|
Originally posted by: matteo.rocco.icona.it
Erica Jackson ha scritto:
>
> I have never really used the Web Viewer example, so I am not sure what
> exactly to put in as the image location, but at least this is a start in
> the right direction.
> Since your charts are showing up in PDF, but not HTML, I would think
> that the image location is definitely your problem. I hope this helps.
>
I already did it and it didn't solve anything :-(
essentially:
I have installed tomcat in:
/home/myuser/tomcat
birt-runtime in:
/home/myuser/tomcat/birt-runtime
my .rptdesign in:
/home/myuser/tomcat/webapps/birt-viewer
Tomcat is running on port 20005 instead of 8080
All the images (one) and charts (one) are created in:
/home/myuser/tomcat/webapps/birt-viewer/report/images
The image is saved with name designX (without extension), chart with
name customX.png
PDF report works fine
HTML report produced this code for the chart:
<div>
<img id="AUTOGENBOOKMARK_4" element_type="EXTENDED" iid="/72(QuRs0:0)"
src="/birt-viewer/run?__imageID=customX.png" alt="" style=" width:
400px; height: 200px;">
</div>
but it's not displayed
I've already added option -Djava.awt.headless=true in catalina.sh
I don't know what else to do... I'm desperate...
Matteo
|
|
|
|
|
|
|
Re: Charts not displayed [message #219730 is a reply to message #217919] |
Mon, 19 February 2007 10:13 |
Eclipse User |
|
|
|
Originally posted by: matteo.rocco.icona.it
All works fine!
The problems was my wrong internal configuration :-(
Matteo
> Erica Jackson ha scritto:
>>
>> I have never really used the Web Viewer example, so I am not sure what
>> exactly to put in as the image location, but at least this is a start
>> in the right direction. Since your charts are showing up in PDF, but
>> not HTML, I would think that the image location is definitely your
>> problem. I hope this helps.
>>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.05154 seconds