Sign in to follow this  
Homesick

Problem In Printing Fusioncharts Using Chrome Browser

Recommended Posts

Dears,,

 

I have installed the latest version of FusionCharts Professional XT (3.2.2),,

I solved printing charts in mozilla firefox browses by enabling printManager feature. But I still face a problem in printing FusionCharts in chrome (charts do not appear at all)

 

Any ideas ??

 

Thanks

Share this post


Link to post
Share on other sites
Guest Sumedh

Hey,

 

To enable communication between charts and JavaScript (like updating data, retrieving data, printing, exporting, event handling etc.) in your local machine, you need to setup Flash Player Global Security settings.

 

Flash Player's Global Security implementation blocks JavaScript to interact with charts (Flash charts) when you are running the the web page or application with charts from local file system. To configure Flash Player Global Security Settings (to enable links and chart APIs) and enable JavaScript calls from charts, you will need to add the folder containing the chart SWF files to Flash Player's Trusted Zone.

 

Please refer to How to Setup Flash Player Global Security Settings page for a detailed step-by-step guide : http://docs.fusionch...HowToSetup.html

 

For managed printing in Chrome Browser, could you please try using the following code?

 

Ref. Code:

FusionCharts.printManager.enabled(true);

 

Once enabled, all the charts present in a page are prepared to print correctly. Once the charts are ready, which can be tracked by listening to an event raised by the Print Manager, you can use browser's File > Print menu, JavaScript's native window.print() function or Print Manager's advanced function - managedPrint(). In any of these actions, the charts would come-up properly in the print media.

 

Hope this helps.

Share this post


Link to post
Share on other sites

Thanks Sumedh

 

Your solution for managing print charts in chrome and safari is valid :) , but I face a new problem :

 

I am using an html form to submit a chart to another page using POST method ,, the chart appears in i.e and firefox but does not appear in chrome and safari ,,

so how could I solve such issue??

 

Thanks

HomesicK

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

Can you please paste your sample code here? So that, we can test ?

 

Awaiting your response.

Share this post


Link to post
Share on other sites

Thanks for rapid response ,,

 

As per your request, I 've tried to collect the required code from multiple php and js files as following

 


<table>
  <tr>
     <td id="page_content">

<table>
<tr>
     <td valign="top"><div id="chartdiv" align="center" > </div></td>
  </tr>
</table>


</td>
  </tr>
</table>

<img alt="image" src="images/printButton.png" class="title_icons" onclick="javascript:print_content();" />

<form name="printForm" action="print.php" target="_blank" method="post" id="printForm">
 <input name="printcontent" type="hidden" id="printcontent" value="" />
</form>

<script type="text/javascript">
var 	chart = new FusionCharts("../fusion_charts/Line.swf", "ChartId", "100%", "220", "0", "0");
var strURL = "../public/Column3D.php?issuer_no=123456";
strURL = escape(strURL);
chart.setDataURL(strURL);
chart.setTransparent(true);
chart.render("chartdiv");



function print_content() {
       var objContent = document.getElementById('printcontent');
       var objPageContent = document.getElementById('page_content');
       var objPrintForm = document.getElementById('printForm');

objContent.value = objPageContent.innerHTML;

       objPrintForm.submit();
}
</script>

 

 

When I press the img icon (printButton.png)--> function print_content() will send the chart to print.php page which is a user friendly page used to print the content of any page in my website. This mechanism is valid when I use it in i.e and firefox ,, the chart appears there with no problem, but in chrome and safari does not.

 

I hope the above Idea is clear,, if not, please do not hesitate to ask ,,

thanks

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

Can you please check on following points?

 

 

> Can you check if the specified chart is coming in the string or not?

var strURL = "../public/Column3D.php?issuer_no=123456";

 

> You are using setDataURL method here, it is a deprecated method.

 

> If you are printing charts on POST method, make sure that you have included all the FusionCharts .js files on that page.

 

Awaiting your response.

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi

 

Thanks for pointing out this issue. We are looking into this.

 

We shall update you at the earliest.

 

Thanks for your time and support.

Share this post


Link to post
Share on other sites

Hello All, <br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); "><br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); ">Here is an issue here.<br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); "><br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); ">When i export a Fusion chart from JasperSoft into a PDF file, its displaying the chart with the same size as given. <br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); "><br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); ">But, when i am printing the PDF, the fusion chart gets printed in a very small size. Even it shows smaller in the .xps file. All other components other than fusion chart in the PDF file are printed fine. The size issue is only with the fusion chart. <br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); "><br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); ">Plz help me out with this issue. <br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); "><br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); ">Thanks a lot in advance. <br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); "><br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); "><br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); ">Nilesh Attargekar.

Share this post


Link to post
Share on other sites
Guest Sumedh

Hello All, <br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); "><br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); ">Here is an issue here.<br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); "><br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); ">When i export a Fusion chart from JasperSoft into a PDF file, its displaying the chart with the same size as given. <br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); "><br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); ">But, when i am printing the PDF, the fusion chart gets printed in a very small size. Even it shows smaller in the .xps file. All other components other than fusion chart in the PDF file are printed fine. The size issue is only with the fusion chart. <br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); "><br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); ">Plz help me out with this issue. <br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); "><br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); ">Thanks a lot in advance. <br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); "><br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); "><br style="color: rgb(107, 107, 107); font-family: verdana, arial, tahoma, sans-serif; line-height: 18px; background-color: rgb(247, 247, 247); ">Nilesh Attargekar.

 

Hi,

 

Please refer this post: http://forum.fusioncharts.com/topic/9993-server-side-exporting-fusion-charts-to-pdf/page__p__45397__hl__dpi__fromsearch__1#entry45397

Share this post


Link to post
Share on other sites

Dear All,

 

I would like to share with you the fix I found to the above issue:

 

Just add the following php command to the header of the file used to print the chart using POST method:

 

header("X-XSS-Protection: 0");

 

Dear Supreme Being,

 

Please is there any drawbacks to use such command ??

 

Thanks

Share this post


Link to post
Share on other sites
Guest Sumedh

Dear All,

 

I would like to share with you the fix I found to the above issue:

 

Just add the following php command to the header of the file used to print the chart using POST method:

 

header("X-XSS-Protection: 0");

 

Dear Supreme Being,

 

Please is there any drawbacks to use such command ??

 

Thanks

 

 

Hi,

 

There are no drawbacks of using XSS command, as it is a part of W3C standard.

 

 

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