Sign in to follow this  
Deepthi

Issue With Fusionchart V3.2 Export Component

Recommended Posts

I am facing an issue with fusion chart v3.2 export component. I have many charts in a web page. I have provided an upload image button with each chart. When i select one of the charts to export it is doing screen capture and then shows the chart name in a div (since i use batchexport also). It is working fine the first time. After one upload if a again click upload then the screen capture is done successfully, but the charts are not shown in the export div. What sould be the issue?

 

The same code was working fine with Fusioncharts v3.1

 

Note: I am using the batch export script for doing both batch and individual exports. In both cases the issue arises.

 

Thanks

Deepthi

post-10432-083204400 1292511348_thumb.jpg

Share this post


Link to post
Share on other sites
Guest Angie

Hi,

 

Welcome to FusionCharts Forum!smile.gif

 

Could you please send us the code you are using here, for us to have a look into the issue?

 

Awaiting your reply.

Share this post


Link to post
Share on other sites

This is the script which is called at the button click:

 

 

function FC_BatchExportSettings(cbControl, fcid) {

 

myExportComponent = null;

 

var Ids = new Array();

 

var isMultipleCharts = false;

 

document.getElementById('<%=btnCancelComponent.ClientID %>').disabled = true;

 

if (fcid == null || fcid == '') {

 

var chkCharts = document.getElementById('<%= chkCharts.ClientID %>');

 

var chkChartsItems = chkCharts.getElementsByTagName("span");

 

for (var i = 0; i < chkChartsItems.length; i++) {

 

if (chkChartsItems.outerHTML.toString().indexOf(" CHECKED ") != -1) {

 

Ids[index] = chkChartsItems.getAttribute("ReportId");

 

index++;

 

}

 

}

 

}

 

else {

 

index = 1;

 

chartCount = 0;

 

if (fcid.indexOf('~') > -1) {

 

isMultipleCharts = true;

 

Ids = fcid.split('~');

 

}

 

else

 

Ids[0] = fcid;

 

}

 

var modalCharts = $find('bIdCharts');

 

var modalComponent = $find('bIdComponent');

 

var lblError = document.getElementById('<%= lblError.ClientID %>');

 

if (Ids && Ids.length > 0) {

 

if (lblError != null)

 

lblError.style.display = "";

 

//check and create design accordingly.

 

 

 

document.getElementById('<%=divStatus.ClientID %>').innerHTML = 'Capturing charts...Please wait...';

 

myExportComponent = new FusionChartsExportObject("fcExporter1", "../../App_Themes/FusionCharts/FCExporter.swf");

 

//debugger;

 

myExportComponent.sourceCharts = Ids;

 

myExportComponent.exportAtClient = 1;

 

//------ Export Component Attributes ------//

 

myExportComponent.componentAttributes.fullMode = '1';

 

//Set saving mode as both. This allows users to download individual charts/ as well as download all charts as a single file.

 

if (fcid == null || fcid == '' || isMultipleCharts == true) {

 

if (isMultipleCharts == true) {

 

myExportComponent.componentAttributes.saveMode = 'batch'; //'both';

 

myExportComponent.componentAttributes.height = '70';

 

document.getElementById('<%= pnlExport.ClientID %>').style.height = '200'

 

}

 

else {

 

myExportComponent.componentAttributes.saveMode = 'both'; //'both';

 

myExportComponent.componentAttributes.height = '240';

 

document.getElementById('<%= pnlExport.ClientID %>').style.height = '370'

 

}

myExportComponent.componentAttributes.defaultExportFilename = 'Charts';

 

myExportComponent.exportAttributes.exportFileName = 'Charts'

 

myExportComponent.componentAttributes.defaultExportFormat = 'PDF';

 

myExportComponent.exportAttributes.exportFormat = 'PDF';

 

}

 

else {

 

myExportComponent.componentAttributes.saveMode = 'individual';

 

myExportComponent.exportAttributes.exportFormat = 'PDF';

 

myExportComponent.exportAttributes.exportFileName = 'Charts'

 

myExportComponent.componentAttributes.height = '70';

 

document.getElementById('<%= pnlExport.ClientID %>').style.height = '200'

 

}

 

//Cosmetics

 

myExportComponent.exportAttributes.showExportDialog = '1';

 

myExportComponent.componentAttributes.fullMode = '1';

 

myExportComponent.componentAttributes.width = '600';

 

myExportComponent.componentAttributes.comboHeight = '60';

 

myExportComponent.componentAttributes.showMessage = '1';

 

myExportComponent.componentAttributes.showAllowedTypes = '0';

 

myExportComponent.componentAttributes.vMargin = 0;

 

myExportComponent.componentAttributes.borderColor = '00000';

 

myExportComponent.componentAttributes.showMessage = '0';

 

//

 

document.getElementById("fcexportDiv").innerHTML = "";

 

//Render the exporter SWF in our DIV fcexpDiv

 

myExportComponent.Render("fcexportDiv");

 

if (fcid == null || fcid == '') {

 

modalCharts.hide();

 

}

 

modalComponent.show();

 

 

 

myExportComponent.BeginExport();

 

}

 

else {

 

if (lblError != null) {

 

lblError.style.display = "block";

 

}

 

modalComponent.hide();

 

}

 

isMultipleCharts = false;

 

return false;

 

}

 

//This event is raised when the chart has finished capture phase and passed the data to

 

//Export Component for further processing

 

function FC_ExportReady(DOMId) {

 

debugger;

 

chartCount++;

 

if (chartCount == index) {

 

document.getElementById('<%=divStatus.ClientID %>').innerHTML = 'Capturing Finished...Please Save...';

 

document.getElementById('<%=btnCancelComponent.ClientID %>').disabled = false;

 

}

 

alert(document.getElementById("fcexportDiv").innerHTML);

 

}

 

//This event is raised when an individual chart has been successfully saved on user's disk (post click of button)

 

function FC_Exported(objRtn) {

 

debugger;

 

if (objRtn.statusCode == "1") {

 

document.getElementById('<%=divStatus.ClientID %>').innerHTML = 'Chart Saved Successfully...';

 

} else {

 

alert("There was an error saving the chart. Error message: " + objRtn.statusMessage + ". Its DOM Id is " + objRtn.DOMId);

 

}

 

}

 

//This event is invoked when the user clicked on Save-All button and all the charts were saved on user's disk

 

//as a single file.

 

function FC_BatchExported(objRtn) {

 

if (objRtn.statusCode == "1") {

 

document.getElementById('<%=divStatus.ClientID %>').innerHTML = 'Charts Saved Successfully...';

 

} else {

 

alert("There was an error saving the chart. Error message: " + objRtn.statusMessage);

 

}

 

}

 

Awaiting ur reply...

 

Thanks & Regards

 

Deepthi

 

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