KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /home/queenjbs/www/FusionChart/Contents/exporting-image/batch-exporting/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/queenjbs/www/FusionChart/Contents/exporting-image/batch-exporting/ECBatchOverride.html
<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Exporting Charts as PDF or Images - Batch export - Over-riding export parameters </title>
<link rel="stylesheet" href="../../assets/ui/css/style.css" type="text/css" />
<script type="text/javascript" src="../../assets/prettify/prettify.js"></script>
<link rel="stylesheet" type="text/css" href="../../assets/prettify/prettify.css" />
<script type="text/javascript" src="../../assets/ui/js/jquery.min.js" ></script>
<style type="text/css">
<!--
div.WebHelpPopupMenu { position:absolute;
left:0px;
top:0px;
z-index:4;
visibility:hidden; }

a.whtbtnhide, a.whtbtnshow, a.whtbtnhidenav , a.whtbtnshownav { border-bottom:none !important; }
-->
</style>
<script type="text/javascript" language="javascript1.2" src="../../assets/ui/js/whmsg.js"></script>
<script type="text/javascript" language="javascript" src="../../assets/ui/js/whver.js"></script>
<script type="text/javascript" language="javascript1.2" src="../../assets/ui/js/whproxy.js"></script>
<script type="text/javascript" language="javascript1.2" src="../../assets/ui/js/whutils.js"></script>
<script type="text/javascript" language="javascript1.2" src="../../assets/ui/js/whlang.js"></script>
<script type="text/javascript" language="javascript1.2" src="../../assets/ui/js/whtopic.js"></script>
<script type="text/javascript" src="../../assets/ui/js/lib.js"></script>
</head>

<body>
<!-- breadcrumb starts here -->
<div id="breadcrumb"></div>
<script type="text/javascript">
	document.write( addFCBreadcrumb( [ "Home|../../Introduction/Overview.html", "Exporting as Image/PDF|../ECOverview.html", "Batch exporting|ECBatchOverview.html", "Over-riding export parameters" ] ) );
</script>
<!-- breadcrumb ends here -->


<table width="98%" border="0" cellspacing="0" cellpadding="3" align="center">
  <tr> 
    <td class="pageHeader">Over-riding export parameters </td>
  </tr>
  <tr>
    <td valign="top" class="text"><p>Using the Export Component JavaScript object, you can also over-ride the export parameters that you have specified for each chart in XML. This is particularly useful in particular scenarios:</p>
      <ul>
        <li>When your XML has parameters related to Server-side export (say saving on server-disk) to be used by some part of code in that page. But if you also want your user to be able to instantly download a snapshot of the chart (using Client-side exporter) by calling another routine. In this case, when the user clicks on a button, you can over-ride the export parameters specified in the XML (set <span class="codeInline">exportAtClient</span> to 1, specify client-side <span class="codeInline">exportHandlers</span>) and then start export routine. </li>
        <li>When in a batch mode, you do not want the charts to show Export Dialog box. You can then over-ride the show dialog box property at run-time, thereby eliminating the need to specify the same in XML. So, when users export individual charts, they do see the dialog box. But, when your batch process starts, the dialog can be hidden, thereby enabling the process to carry on silently in the background.</li>
        <li>Change call-backs at run-time, depending on your application</li>
        <li>Change export format and file name at run-time, if needed  </li>
      </ul>
    <p>The list of parameters that can be over-ridden this way is as under: </p></td>
  </tr>
  <tr>
    <td valign="top" class="text"><table width="98%" cellpadding="2" cellspacing="0" border="0" class="table">
      <tr>
        <td width="19%" class="header">Attribute Name</td>
        <td width="16%" class="header">Value Type</td>
        <td width="54%" class="header">Description</td>
        </tr>
      <tr>
        <td valign="top" class="text" scope="col"><div align="left">exportHandler</div></td>
        <td valign="top" class="text">string</td>
        <td valign="top" class="text">In case of Server side exporting, this refers to the path of the Server-side Export Handler (the ready-to-use scripts that we provide).
          <p>In case of Client-side exporting, this refers to the DOM Id of FusionCharts Export component that is embedded in your web page, along with the chart. </p></td></tr>
      <tr>
        <td valign="top" class="text" scope="col"><div align="left">exportAtClient</div></td>
        <td valign="top" class="text">boolean<br />
          (0/1) </td>
        <td valign="top" class="text"> Whether to use Client side Export Handlers, or Server-side Export Handlers.
          <p><strong>Note:</strong> By default the value is set to 0 which means the export is supposed to  be done at server side.</p></td></tr>
      <tr>
        <td valign="top" class="text" scope="col"><div align="left">showExportDialog</div></td>
        <td valign="top" class="text">boolean<br />
          (0/1)</td>
        <td valign="top" class="text">Whether to show the export dialog during capture phase. If not, the chart starts capturing process without the dialog visible.</td>
      </tr>
      <tr>
        <td valign="top" class="text" scope="col"><div align="left">exportFormat</div></td>
        <td valign="top" class="text">string<br />
          ('PNG' / 'JPG' / 'PDF')</td>
        <td valign="top" class="text">You can choose the format in which the chart is exported.</td>
      </tr>
      <tr>
        <td valign="top" class="text" scope="col"><div align="left">exportFileName</div></td>
        <td valign="top" class="text">string</td>
        <td valign="top" class="text">Using this attribute you can specify the name  (excluding the extension) of the file to be exported.
          <p>When Server-side&ndash;save  export&nbsp;is specified this attribute must provide the relative path of the destination file that is going to be  saved to the server.<br />
          For example,
          &ldquo;../gallery/charts/myExpenseChart&rdquo;</p></td></tr>
      <tr>
        <td valign="top" class="text" scope="col"><div align="left">exportAction</div></td>
        <td valign="top" class="text">string <br />
          ('download' / 'save') </td>
        <td valign="top" class="text"> In case of Server-side exporting, the action specifies whether the exported image will be sent back to client as download, or whether it will be saved on the server.
          <p><strong>Note:</strong> Thus is only available for Server-side export.</p></td></tr>
      <tr>
        <td valign="top" class="text" scope="col"><div align="left">exportTargetWindow</div></td>
        <td valign="top" class="text">string<br />
          ('_self' / '_blank')</td>
        <td valign="top" class="text">In case of Server-side exporting and when using download as action, this lets you configure whether the return image/PDF will open in same window (as an attachment for download), or whether it will open in a new window. 
          <p><strong>Note:</strong> Thus is only available for Server-side export.</p></td></tr>
      <tr>
        <td valign="top" class="text" ><div align="left">exportCallback</div></td>
        <td valign="top" class="text">string</td>
        <td valign="top" class="text">This attribute specifies the name of the callback JavaScript  function which will be called when the export event is complete.
          <p>The internal JavaScript function <em>FC_Exported </em>is the default method that will be called when no value specified.</p></td></tr>
    </table><br /></td>
  </tr>
  <tr>
    <td valign="top" class="header">An Example  </td>
  </tr>
  <tr>
    <td valign="top" class="text"><p>Let us quickly see an example how to hide the Export dialog box of all charts during a batch process. To do so, we just add the following line to our Export Component code: </p></td>
  </tr>
  <tr>
    <td valign="top"><pre class="prettyprint code_container">&lt;script type=&quot;text/javascript&quot;&gt;
&nbsp;&nbsp;&nbsp;<span class="codeComment">//Initialize Batch Exporter with DOM Id as fcBatchExporter</span>
&nbsp;&nbsp;&nbsp;var myExportComponent = new FusionChartsExportObject(&quot;fcBatchExporter&quot;, &quot;../../FusionCharts/FCExporter.swf&quot;);
&nbsp;&nbsp;<span class="codeComment">&nbsp;//Add the charts to queue. The charts are referred to by their DOM Id.</span>
&nbsp;&nbsp;&nbsp;myExportComponent.sourceCharts = ['myChartId1','myChartId2','myChartId3'];
&nbsp;<span class="codeComment">&nbsp;&nbsp;//------- Export related Attributes ------//</span>
&nbsp;&nbsp;&nbsp;<strong>myExportComponent.exportAttributes.showExportDialog = '0';</strong>
&nbsp;&nbsp;&nbsp;<span class="codeComment">//------ Export Component Attributes ------//
&nbsp;&nbsp;&nbsp;//Set the mode as full mode</span>
&nbsp;&nbsp;&nbsp;myExportComponent.componentAttributes.fullMode='1';
&nbsp;&nbsp;&nbsp;<span class="codeComment">//Set saving mode as both. This allows users to download individual charts/ as well as download all charts as a single file.</span>
&nbsp;&nbsp;&nbsp;myExportComponent.componentAttributes.saveMode='both';
&nbsp;&nbsp;&nbsp;<span class="codeComment">//Show allowed export format drop-down</span>
&nbsp;&nbsp;&nbsp;myExportComponent.componentAttributes.showAllowedTypes = '1';
&nbsp;&nbsp;&nbsp;<span class="codeComment">//Cosmetics 
&nbsp;&nbsp;&nbsp;//Width and height</span>
&nbsp;&nbsp;&nbsp;myExportComponent.componentAttributes.width = '350';
&nbsp;&nbsp;&nbsp;myExportComponent.componentAttributes.height = '140';
&nbsp;&nbsp;&nbsp;<span class="codeComment">//Message - caption of export component</span>
&nbsp;&nbsp;&nbsp;myExportComponent.componentAttributes.showMessage = '1';
&nbsp;&nbsp;&nbsp;myExportComponent.componentAttributes.message = 'Click on button above to begin export of charts. Then save from here.';
&nbsp;&nbsp;&nbsp;<span class="codeComment">//Render the exporter SWF in our DIV fcexpDiv</span>
&nbsp;&nbsp;&nbsp;myExportComponent.Render(&quot;fcexpDiv&quot;); 
&lt;/script&gt;</pre></td>
  </tr>
  <tr>
    <td valign="top" class="text"><p>See it <a href="../../../Code/ExportChartSamples/BatchExport/OverrideAtts.html" target="_blank">live</a>!
    </p><p>As you can see above, the format is:</p>
    <pre class="code_container prettyprint">export_object.exportAttributes.parameter='value';</pre>
    <p>When you run the above example and initiate Batch export, you will see that the capturing phase does not show export dialog any more. This saves you the trouble of specifying the parameter in each chart's XML. </p></td>
  </tr>
</table>
<!-- footer links starts-->
<div id="fcfooter"></div>
<script type="text/javascript">
	document.getElementById("fcfooter").innerHTML =  addFCFooter("Setting JavaScript callback|ECBatchCallback.html","JavaScript Reference - JavaScript API|../javascript-ref/ECReferenceJS.html");
</script>
<!-- footer links ends -->
<script type="text/javascript" language="javascript1.2">//<![CDATA[
<!--

	highlightSearch();

//-->
//]]></script>
</body>
</html>

Anon7 - 2021