Sign in to follow this  
kendo

Cannot open the downloaded Image

Recommended Posts

Hi,

 

 

 

I've downloaded the evaluation version today and tried to create Pie3D chart with image downloadable option using jsp.

 

The Pie3D chart can display and download successfully, but the downloaded image cannot open with image viewer program.

 

 

 

Below is my development environment

 

- JDK 1.5.0.15

 

- BEA weblogic 10

 

 

 

*** Note that I used original FusionChartsSave.jsp from folder ImageSaving ***

 

 

 

The attached file is my generated HTML code

 

 

 

Thanks,

 

Ken

myTestPieChart.txt

Share this post


Link to post
Share on other sites
Pallav (6/3/2008)
Hi Ken,

 

Is the chart exporting as image on the first hand?

Hi,

I'm not sure I understand what does "Is the chart exporting as image on the first hand?" mean, but here is the scenarios I've done with

  1. Made a http request to servlet.
  2. Created XML data and stored in session.
  3. Forwarded the request to jsp to display Pie3D chart using XML data in session.
  4. Pie3D chart was displayed successfully.
  5. Right clicked on the chart an selected "Save as image".
  6. Image was downloaded successfully.
  7. Opened the downloaded image with Windows Picture Viewer.
  8. Got message "No preview available".

This is my development environment

  • Windows XP
  • JDK 5.0
  • BEA Weblogic 10
  • IE7

I also tested this in Firefox, but still got the same result.

Thanks,

Ken

Share this post


Link to post
Share on other sites
Sudipto Choudhury (6/3/2008)
Hi,

Could you please make sure that the Image is being Downloaded Successfully at step 6?

If you are using the original jsp image savinf script from the Download Pack, it would prompt to show/save the image.

Yes, the browser popup the dialog to show/sace image. I can download the image without problem (the download status bar was shown on the chart), but the downloaded image cannot display using image viewer program.

 

Do I have to setup any additional configurations?

Anyway, could you provide me the original saving script for JSP? I will compare it with the version I've downloaded

Thanks,

Ken

Share this post


Link to post
Share on other sites

I have same problem. The image is corrupt after saving.

 

 

 

I'm using java 1.4.2 weblogic 8 and the downloaded script FusionChartsSave.jsp from the latest version.

Edited by Guest

Share this post


Link to post
Share on other sites

It looks like a bug in FusionChartsSave.jsp, because the data is being sent in the request, but the created image file can't be opened in browsers or ms image viewer.

Edited by Guest

Share this post


Link to post
Share on other sites

It looks like the .jsp is adding 5 new line characters at the start of the image file because of the imports, if I remove these new line characters, the image opens everywhere fine. I'm going to put the code from the jsp in a class to avoid this.

Share this post


Link to post
Share on other sites

Dear Srividya,

  Excellent work. Thanks a lot.  Now i can save all the chart images.

Thanks once again. Keep in touch.

Regds,

Sachin.H

Abu Dhabi.

 

Edited by Guest

Share this post


Link to post
Share on other sites

Dear Srividya,

  I need to Save this images in my server only, when i hit the save button . Please help me.

And also please send me the code to save the multiple charts as one single image(like attached sample image). Please help.

Please refer the attachment for code.

 Regds,

Sachin.H

Share this post


Link to post
Share on other sites

I have gone through the attached code. The javascript part seems to be ok. I assume that you have given the imageSave and imageSaveURL attributes in the xml.

The last few lines of FusionChartsSave.jsp contains the following code to stream the image output:

OutputStream os = response.getOutputStream();
 ImageIO.write(chart, "jpeg", os);
 os.close();

Please change these lines to save the image on the server. Use FileOutputStream to write to the file.

I expect that this will do the job!

Edited by Guest

Share this post


Link to post
Share on other sites

Dear Srividya,

Thanks for the reply. I tried as you said like below,

File f=new File("FusionCharts_Evaluation/Temp_Image/"+sdf.format(today)+".png");

ImageIO.write(chart,"png",f);

  Need some more help

1. The image is created. but, how i can pass the image name('101208.jpg') from (ExportChart.jsp to FusionChartsSave.jsp)

2. If i hitting the save button in ExportChart.jsp is redirecting to FusionChartsSave.jsp to save the image. Can u please help me to save the image with in the ExportChart.jsp only to save the image in my server. 

3. How i can save these four charts(ExportChart.jsp) as one single image.

Please help me.

Regds,

Sachin.H

Share this post


Link to post
Share on other sites

Hi,

 
For 1 and 2nd please see this:
 
1. You could not pass file name to FusionChartsSave.jsp. Otherwise you would need to include your file name in the query string of imageSaveURL, like the following:
 
a. imageSaveURL="{path}/FusionChartsSave.jsp?filename=MSColumn2D.png&refurl={path to exportchart.jsp}" for MSColumn2D.xml
b. imageSaveURL="{path}/FusionChartsSave.jsp?filename=MSLine.png&refurl={path to exportchart.jsp}" for MSLine.xml
c. imageSaveURL="{path}/FusionChartsSave.jsp?filename=MSArea2D.png&refurl={path to exportchart.jsp}" for MSArea2D.xml
d. imageSaveURL="{path}/FusionChartsSave.jsp?filename=Pie2D.png&refurl={path to exportchart.jsp}" for Pie2D.xml 
 
and after that need to modify FusionChartsSave.jsp as follow:
File F=new File("/{path}/"+request.getParameter("filename")); 
 
Also at the end please append this (just after chart=null);
 
response.sendRedirect(request.getParameter("refurl"));
 
 
2. and 3. is not possible as of now.
Edited by Guest

Share this post


Link to post
Share on other sites

Dear Rahul,

  1. Is it possible to remove the background color of attached chart image(Column3D.png),becaz i am not able to see the background image.

  2. Need to bring into background image(google image) into center position, in the attached chart image(MSColumn3D.png)

Please refer the xml files for above charts. Please help me if possible send me the codes.

Regds,

Sachin.H

Edited by Guest

Share this post


Link to post
Share on other sites

Hi,

 

 

 

You would need to make chart transparent, and also, need to use bgalpha='0' in the XML in <chart> element.

 

 

 

Please download the attached file, I have added a new parameter to createChart function, i.e. setTransparent, use it as follows:

 

 

 

String chartCode= createChart("../../FusionCharts/Pie3D.swf", strDataURL, "", "FactorySum", 600, 300, false, false,true);

 

 

 

also in the XML's [chart ] element, please add bgAlpha='0'.

FusionCharts.zip

Share this post


Link to post
Share on other sites

Hi Vidya,

  1.Can we add Y axis(Line) in Chart Column3D (Column3D.png)

  2.Is it possible to fill the bright color in MSColumn3D Chart(MSColumn3D.png),becaz, the color is starting from light to bright.

Regds,

Sachin.H

Share this post


Link to post
Share on other sites

Dear Vidya,

 

 

 

I tried using vLine color='FF5904' thickness='2', but still i am not getting the Y-Axis.

 

Please refer the attachment image & xml, I need to draw the Line which is highlighted in red color with in the circle .

 

Please help.

 

 

 

Regds,

 

Sachin.H

Edited by Guest

Share this post


Link to post
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
Sign in to follow this