Jump to content
We've recently updated our Privacy Statement, available here ×

how to force image(chart) output


andrei_3
Go to solution Solved by andrei_3,

Recommended Posts

In my application data for report coming from REST service. Report contain 1 image( logo), table with data and timeaxis chart for table visualization.

When I sent 1-st request in response I ve got 1 POST and 2 GET for image. Like that:

127.0.0.1 - - [05/Sep/2014:12:30:40 +0300] "POST /report/tripDynamic/HTML HTTP/1.1" 200 13161
127.0.0.1 - - [05/Sep/2014:12:30:40 +0300] "GET /image?image=img_0_0_1 HTTP/1.1" 200 32296
127.0.0.1 - - [05/Sep/2014:12:30:40 +0300] "GET /image?image=img_0_0_8 HTTP/1.1" 200 13213
 
then I change one parameter in web form (month) and try to get new report, application sends only one POST request
127.0.0.1 - - [05/Sep/2014:12:31:13 +0300] "POST /report/tripDynamic/HTML HTTP/1.1" 200 13161
data in output table changed according request , but chart is old, from first report.
 
How to force image request!!!?
 
Tags for chart:
     <image scaleImage="RealSize" hAlign="Center" vAlign="Middle">
    <reportElement mode="Opaque" x="0" y="0" width="505" height="270" uuid="2efe2e09-2042-4832-8f8d-0dcb7780bfec"/>
    <imageExpression><![CDATA[$P{chartUtils}.createLineChart($F{trips}, $F{violations}, $F{coefficients}, $F{titles}, $F{dates}, $F{range}, $F{type})]]></imageExpression>
    </image>
 
 
 
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Solution

Problem solved by adding one more identificator.

To capture image by servlet was proposed add to handle image path like 

			exporterOutput = new SimpleHtmlExporterOutput(response.getOutputStream());			exporterOutput.setImageHandler(new WebHtmlResourceHandler("image?image={0}"));			exporterHTML.setExporterOutput(exporterOutput);[/code]
we just change it a little:
 
        exporterOutput.setImageHandler(new WebHtmlResourceHandler( "image?" + ImageServlet.IMAGE_NAME_REQUEST_PARAMETER + "={0}" + "&uuid=" + UUID.randomUUID().toString()));
 
 
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...