srividya_sharma

Chart Export Problem in IE

Recommended Posts

I have implemented the server side export function of fusion chart in my application under Weblogic Server 11g. In firefox, i can right click the chart and select the export type to export image or pdf successfully. However, it is fail if i first right click the export the chart in IE. It open a file download dialog, but the file name is FCExporter._jsp and Type is HTML Plugin Document, instead of pdf/jpg. It is strange that the problem is disappeared when i tried to export again by the same method.

 

Please help. Thanks.

 

 

 

Regards,

 

Ryan

Edited by Guest

Share this post


Link to post
Share on other sites

Hi,

 

 

 

We are having exact same problem. Our company has upgraded to FusionCharts 3.1, and we have just noticed the chart export mechanism is completely changed.

 

 

 

We are using server-side mode, download, jsp on Tomcat 6.

 

Problem happens in IE8, Win7, we do use HTTPS(SSL).

 

It works on Firefox 3.6.

 

 

 

Chart export params:

 

exportEnabled="1"

 

exportShowMenuItem="1"

 

exportFormats="PNG=Export as PNG|JPG=Export as JPEG|PDF=Export as PDF"

 

exportAtClient="0"

 

exportAction="download"

 

exportFileName=... chart name ...

 

exportHandler=...web root.. + "/FusionCharts/ImageSaving/FCExporter.jsp"

 

exportTargetWindow="_self"

 

 

 

Here is what happens in IE:

 

- it waits a long time

 

- then asks to download FCExporter_jsp

 

- then it reports "Unable to download FCExporter_jsp".

 

 

 

When exportTargetWindow="_blank" the jsp throws NullPointerException:

 

java.lang.NumberFormatException: null

 

at java.lang.Integer.parseInt(Integer.java:415)

 

at java.lang.Integer.parseInt(Integer.java:497)

 

at com.fusioncharts.exporter.FusionChartsExportHelper.parseExportRequestStream(FusionChartsExportHelper.java:190)

 

at org.apache.jsp.FusionCharts.ImageSaving.FCExporter_jsp._jspService(FCExporter_jsp.java:188)

 

 

 

Could you please check this? We are tight on time on delivering this fix.

 

 

 

Thanks,

 

Igor Kusakov,

 

Trustwave

Share this post


Link to post
Share on other sites

Hello,

Can you please check the mime types mapping once, to see if jpg/png are mapped correctly?

If you can send us a stripped down version of your application or a live URL then we can test/debug directly and tell you the solution.

Also, are you trying this over SSL?

Srividya

Share this post


Link to post
Share on other sites

Hi,

 

 

 

Thanks a lot for answering so quickly!

 

 

 

1. SSL - Yes, we do use SSL.

 

2. I doubt mime mapping is the problem, because:

 

a) The earlier version of FusionChart export jsp was working. The new one still works in FF over SSL - so the IE8 is the problem.

 

:) We use default setup for both IE8 and Tomcat6 - we don't change any default mime settings

 

3. The link you provide does not seem to be related to our problem.

 

We use server-side export - as it was done in the earlier version of FusionCharts.

 

4. I can't send you our application code.

 

5. Any news on that NullPointerException?

 

 

 

Could you please make your chart export demo work on Tomcat6 over SSL?

 

The demo I have downloaded from your web site has a PHP example.

 

There are the jsps in FusionCharts distribution - the problem seems to be in these jsps.

 

You can compare them with the old version of chart export jsp - FusionChartsSave.jsp - which passed our QA, so it was most probably working 2 years ago when we implemented it first.

 

We need server-side/download export mode over SSL. Not client-side export, not sever-side save, not regular HTTP.

 

 

 

I'll keep investigating the issue on my side as well.

 

 

 

Thanks,

 

Igor Kusakov,

 

Trustwave

Share this post


Link to post
Share on other sites

Ok, I got it resolved.

 

 

 

The issue is discussed here: http://forums.thedailywtf.com/forums/t/5134.aspx

 

 

 

They have the fix in PHP. I've adapted it for FCExporter_IMG.jsp and FCExporter_PDF.jsp:

 

 

 

boolean isIE = request.getHeader("User-Agent") != null

 

&& request.getHeader("User-Agent").toUpperCase().indexOf("MSIE") >=0;

 

 

 

if (isIE) {

 

response.setHeader("Pragma", "public");

 

response.setHeader("Expires", "0");

 

response.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0");

 

response.setHeader("Content-Transfer-Encoding", "binary");

 

}

 

 

 

I've also changed the content type to what is considered the best practice in such case:

 

response.setContentType("application/octet-stream");

 

 

 

A similar problem should happen with your php code as well - it does not render the specific IE headers. Did server-side/download export ever worked for you guys?

 

 

 

 

 

A side note - since I was modifying the jsps, I have removed all the code related to server-side saving. It looks like it could be used by a hacker to put/modify arbitrary files on the web server. I have not spent much time auditing the code to say for sure, but it looked dangerous enough and the simplest solution was to remove it. So whoever is putting these jsps on their web site - you better check them.

 

 

 

Thanks,

 

Igor Kusakov,

 

Trustwave

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi,

Glad that your issue is resolved and thanks for sharing your idea.

We will definitely look into the issue that you have brought in our notice and will get back to you on this as soon as possible.

Happy FusionCharting. :)

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