vramineni

FusionCharts Server-side Export Handler

Recommended Posts

Is FusionCharts Server-side Export Handler will supports JDK1.5??

I have found in Readme.txt file

FusionCharts Server-side Export Handler - JSP

==============================================

For exporting the chart as image/pdf at server side using JSP, copy-paste the required files to your server:

1. FCExporter.jsp

2. FCExporterError.jsp

3. fcexporter.jar (contains all the dependency classes) or class files (classes in com.fusioncharts.exporter and sub-packages)

4. Resources/FCExporter_IMG.jsp

5. Resources/FCExporter_PDF.jsp

6. /Classes/fusioncharts_export.properties (configuration files)

Setup

-----

Please place the JSP in your web application, fcexporter.jar in WEB-INF/lib and fusioncharts_export.properties in WEB-INF/classes folder.

FusionCharts Exporter has been tested with Java 6.

The exportHandler attribute should have value "{Path}/FCExporter.jsp".

Configuration of save folder for server-side save

--------------------------------------------------

This is to be done in fusioncharts_export.properties file. Make sure that the folder path that you specify

has write permissions to it.

but we are using JDK1.5, is there any way to work with JDK1.5?

Thanks

Share this post


Link to post
Share on other sites

Hi!

 

Do you have the .class files as well? I'm also using 1.5 and i've tried this jar-file but it did not help. I get the following error message:

Bad version number in .class file (unable to load class com.fusioncharts.exporter.beans.ExportBean)

So is it possible to get the class-files?

/Andreas

Share this post


Link to post
Share on other sites

Hi and thank you for your fast respons!!

 

Sorry but it did not help. I've tried both 1.5 and 1.4.2

 

The error message referes to ExportBean.

Bad version number in .class file (unable to load class com.fusioncharts.exporter.beans.ExportBean)

 

Doesn't this mean that the ExportBean class should be compiled with 1.5 or 1.4.2?

 

/Andreas

Share this post


Link to post
Share on other sites

Hi Andreas,

Place the fusionchartsexporter_j2sdk1.4.2.jar in the WEB-INF/lib folder. Please verify that you DO NOT HAVE the .class files in WEB-INF/classes folder.

Either the class files or the jar - only one of them should be present in your application.

Since you want to use with jdk1.4.2, please use the jar: fusionchartsexporter_j2sdk1.4.2.jar and remove any other older class files present in the classes folder.

Hope this helps!

Srividya

Share this post


Link to post
Share on other sites

Thanks! I did have the class-files, my bad.

 

One step closer, however I still cannot make it work.

 

I've set the export handle to FCExporter.jsf (not JSP since we use JSF)

<chart exportEnabled="1" exportShowMenuItem="1" exportAtClient="0" exportHandler="FCExporter.jsf" exportAction="download" exportFileName="RAS_chart" exportTargetWindow="_self">

 

This is the Info from eclipse:

2009-sep-01 08:52:35 com.fusioncharts.exporter.generators.ImageGenerator getChartImage

INFO: Creating the Chart image

2009-sep-01 08:52:40 com.fusioncharts.exporter.generators.ImageGenerator getChartImage

INFO: Image created successfully

 

Any ideas?

/Andreas

Share this post


Link to post
Share on other sites

Hi Andreas,

I haven't tried with JSF instead of the JSP pages.

If you are using FCExporter.jsf as the name, then you might have to change the references to these 3 jsps - FCExporter_IMG.jsp, FCExporter_PDF.jsp and FCExporterError.jsp ( which are the dependent files ) .

Please try it out.

Srividya

Share this post


Link to post
Share on other sites

Thanks again for your swift response!

 

Where do I find the references to FCExporter_IMG.jsp?

 

I only find references to FCExporterError.jsp

/Andreas

Share this post


Link to post
Share on other sites

It works better but still not exactly as it sould.

 

The first time I right click and choose a jpg or png file, it wants to download FCExport_jsf.

 

However, if I do the samt thing again it works! But its not so great to have to do the export twice in order to get it to work.

 

Do you know if there is a way to initialize it somehow or perhaps a another trick?

/Andreas

Share this post


Link to post
Share on other sites

Hi Andreas,

I have tried with /faces/* and *.jsf in faces-config.xml.

Both the paths work fine for me. The download dialog shows up after "Image Created Successfully" info.

There must be something wrong with mime-type setting. Please see if conf/web.xml has the correct mime type for jsf pages.

Something like this:

    <mime-mapping>
    <extension>jsf</extension>
    <mime-type>text/plain</mime-type>
   </mime-mapping>

Hope this helps! :)

Srividya

Share this post


Link to post
Share on other sites

Thanks so much for trying to help me!

 

But that did not do the trick.

I've attached two popups:

First one happens when I right click and choose save as JPG. It's not correct so i click cancel(Avbryt in Swedish)

 

And then I do the same thin again, no page relod, no nothing. Just right click and save as JPG again and then the dialog2 pops.

 

Strange...

Any other ideas?

post-6157-128441574717_thumb.gif

post-6157-128441574721_thumb.gif

Share this post


Link to post
Share on other sites

Strange though that it works the second time.

I stored the first dialog, the one with FCExporter_jsf and the file actually contains the picture. But it gets the mime-type wrong or something.

Share this post


Link to post
Share on other sites

Yep, same.

 

I'm out of ideas on what it could be.

I't would be better, in a solution finding perspective, that it never worked :) Very strange it works the second time and every time in FF.

Share this post


Link to post
Share on other sites

Hi!

 

Not exactly the same, the first time I get this dialog(translated from Swedish):

---------------------------

Windows Internet Explorer

---------------------------

Internet Explorer could not fetch FCExporter.jsf from XXX.

The page you requested cannot be found at this time. It may be temporarily unavailable or it may have been removed or relocated.

---------------------------

OK

---------------------------

 

And when I do it again it works. Guess it's a 404-error

Share this post


Link to post
Share on other sites

Hi!

 

Sorry but I have not. A good thing is that Fusion Charts are only used in internal system and this problem was OK with the system owners.

 

However if you can come up with any other thoughts in the matter please let me know. And if I find a solution I'll post it here.

 

/Andreas

Share this post


Link to post
Share on other sites

Hi Andreas,

I think it is  a problem with headers.

Can you please try this in your jsp:

response.setHeader("Pragma", "private");
response.setHeader("Cache-Control", "private, must-revalidate");

If it doesn't work there, I will try putting the same in FCExporter_PDF and give you the files.

Please try this out first.

Srividya

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