Jump to content
JasperReports Library 7.0 is now available ×

still cannot showing a pie chart


andysusanto

Recommended Posts

hai,

 

how to show a chart from a servlet ?,

 

i am using ireport 1.2.5 and i add a Boolean value in "Increment When Expression"

 

 

when i run from ireport that chart is show.

 

but when i try to call from a servlet, that i chart cannot show. And there is no error.

 

how a code inside a servlet to show that graph?

 

 

TIA,

 

andy susanto

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Take a look at the webapp sample that is included with JasperReports. The html.jsp shows some options to the JRHtmlExporter that need to be set for the images to work correctly. (Take a look at the HTML returned from the servlet and you will probably see that the image tat used for the chart is wrong.)

 

-Barry

Link to comment
Share on other sites

Take a look at the generated HTML (via View Source or the equivalent in your browser) to figure out where the browser is looking for the images. Then figure out where the images actually have been saved, which depends on the options you set for the JRHtmlExporter. In your case it looks like you haven't set any, so the images are stored on disk in the current directory.

 

When using images you need to think of two things - where do I want to store the images (disk? session?) and how the user will access them (servlet? Direct URL?) and then make sure you set up the exporter to put the images in the right place, and your code to serve them up correctly.

 

Take a look at the JavaDoc for the options that the JRHtmlExporter supports.

 

-Barry

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...