Jump to content


Problem In Printing Fusioncharts Using Chrome Browser


  • Please log in to reply
11 replies to this topic

#1 Homesick

Homesick

    Junior Member

  • Members
  • PipPip
  • 14 posts

Posted 02 April 2012 - 10:56 AM

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

#2 Sumedh

Sumedh

    Supreme Being

  • Administrators
  • 1955 posts
  • LocationBangalore

Posted 02 April 2012 - 11:31 AM

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.
Thanks,
Sumedh

Follow us @Twitter!

#3 Homesick

Homesick

    Junior Member

  • Members
  • PipPip
  • 14 posts

Posted 03 April 2012 - 11:36 AM

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

#4 Sumedh

Sumedh

    Supreme Being

  • Administrators
  • 1955 posts
  • LocationBangalore

Posted 03 April 2012 - 11:46 AM

Hi,

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

Awaiting your response.
Thanks,
Sumedh

Follow us @Twitter!

#5 Homesick

Homesick

    Junior Member

  • Members
  • PipPip
  • 14 posts

Posted 03 April 2012 - 12:50 PM

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

#6 Sumedh

Sumedh

    Supreme Being

  • Administrators
  • 1955 posts
  • LocationBangalore

Posted 04 April 2012 - 10:06 AM

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.
Thanks,
Sumedh

Follow us @Twitter!

#7 Homesick

Homesick

    Junior Member

  • Members
  • PipPip
  • 14 posts

Posted 05 April 2012 - 05:25 AM

I have checked the above notes,
I confuse why the chart is not rendering in chrome and safari but it is rendering in i.e and firefox !!

#8 Sumedh

Sumedh

    Supreme Being

  • Administrators
  • 1955 posts
  • LocationBangalore

Posted 05 April 2012 - 01:16 PM

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.
Thanks,
Sumedh

Follow us @Twitter!

#9 Nilesh Attargekar

Nilesh Attargekar

    Forum Newbie

  • Members
  • 5 posts

Posted 23 April 2012 - 05:02 AM

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.

#10 Sumedh

Sumedh

    Supreme Being

  • Administrators
  • 1955 posts
  • LocationBangalore

Posted 23 April 2012 - 09:41 AM

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.fusionc...h__1#entry45397
Thanks,
Sumedh

Follow us @Twitter!

#11 Homesick

Homesick

    Junior Member

  • Members
  • PipPip
  • 14 posts

Posted 10 May 2012 - 06:02 AM

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

#12 Sumedh

Sumedh

    Supreme Being

  • Administrators
  • 1955 posts
  • LocationBangalore

Posted 14 May 2012 - 09:51 AM

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.


Thanks,
Sumedh

Follow us @Twitter!