Cheiro

Export Handler Not Recognized When Deployed On Iis

Recommended Posts

Hi,

 

I am trying to export Fusion charts server side, the export is initiated through javascript. Its ASP.net application

 

I am using Fusion charts version : FusionCharts v3.2.1 (Released on 6th October 2010)

 

The problem i am facing is... the export happens properly if i run it locally in visual studio through F5...

 

But when i deploy it in IIS and try to browse to the page and export it i get the error saying it was not able to reach the export handler.

 

Please advise on resolving this issue :(

 

The XML is as below

 


<chart exportEnabled='1' exportAction='Save' exportAtClient='0' exportHandler='http://localhost:843/Export_Handler/FCExporter.aspx'
caption='Monthly Unit Sales' xAxisName='Month' yAxisName='Units' showValues='0' formatNumberScale='0' showBorder='1' >
<set label='Jan' value='462' />
<set label='Feb' value='857' />
<set label='Mar' value='671' />
<set label='Apr' value='494' />
<set label='May' value='761' />
<set label='Jun' value='960' />
<set label='Jul' value='629' />
<set label='Aug' value='622' />
<set label='Sep' value='376' />
<set label='Oct' value='494' />
<set label='Nov' value='761' />
<set label='Dec' value='960' />
</chart>

 

The path : http://localhost:843...FCExporter.aspx is valid when i browse to this from IIS i get the below

 


DOMId=
height=0
width=0
fileName=
statusMessage=Insufficient  data.
statusCode=0

 

 

please find the attached screen shots and the aspx code files

 

post-19875-0-88880000-1314360422_thumb.jpg

 

 

code behind :

 


using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using InfoSoftGlobal;

public partial class Export_save : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
   	Literal1.Text = FusionCharts.RenderChart("../FusionCharts/Column3D.swf", "./Data/SaveData.xml", "", "myFirst", "600", "300", true, true);
}
}

 

aspx markup

 


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Save.aspx.cs" Inherits="Export_save" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>FusionCharts - Export Example - Export chart and save the exported file to a server-side folder
</title>
<link href="../assets/ui/css/style.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="../FusionCharts/FusionCharts.js"></script>

<style type="text/css">
   	h2.headline
   	{
       	font: normal 110%/137.5% "Trebuchet MS" , Arial, Helvetica, sans-serif;
       	padding: 0;
       	margin: 25px 0 25px 0;
       	color: #7d7c8b;
       	text-align: center;
   	}
   	p.small
   	{
       	font: normal 68.75%/150% Verdana, Geneva, sans-serif;
       	color: #919191;
       	padding: 0;
       	margin: 0 auto;
       	width: 664px;
       	text-align: center;
   	}
</style>

<script type="text/javascript">

	// this function exports chart
	function exportChart(exportFormat)
	{
			if ( FusionCharts("myFirst").exportChart )
			{
				document.getElementById ( "linkToExportedFile" ).innerHTML = "Exporting...";
				FusionCharts("myFirst").exportChart( { "exportFormat" : exportFormat } );
			}
			else
			{
				document.getElementById ( "linkToExportedFile" ).innerHTML = "Please wait till the chart completes rendering..." ;

			}

	}

	// This event handler function is called by the chart after the export is completed.
	// The statusCode property when found "1" states that the export is successful
	// You can get the access file name from fileName property
	function FC_Exported ( statusObj )
	{
		if ( statusObj.statusCode == "1" )
		{
			document.getElementById ( "linkToExportedFile" ).innerHTML = "Export successful. You can view it from <a target='_blank' href='" + statusObj.fileName + "'>here</a>.";	
		}
		else
		{
			// If the export is found unsuccussful get the reason from notice property
			document.getElementById ( "linkToExportedFile" ).innerHTML = "Export unsuccessful. Notice from export handler : " + statusObj.notice;	
		}
	}


</script>

</head>
<body>
<form id="form1" runat="server">
<div id="wrapper">
   	<div id="header">
       	<div class="back-to-home">
           	<a href="../Default.aspx">Back to home</a></div>
       	<div class="logo">
           	<a class="imagelink" href="../Default.aspx">
               	<img src="../assets/ui/images/fusionchartsv3.2-logo.png" width="131" height="75"
                   	alt="FusionCharts v3.2 logo" /></a></div>
       	<h1 class="brand-name">
           	FusionCharts</h1>
       	<h1 class="logo-text">
           	ASP.NET(C#) Export Examples</h1>
   	</div>
   	<div class="content-area">
       	<div id="content-area-inner-main">
           	<h2 class="headline">
               	Export example - Export chart and save the exported file to a server-side folder</h2>
           	<div class="gen-chart-render">
               	<center>
                   	<asp:Literal ID="Literal1" runat="server"></asp:Literal>
                   	<div id="linkToExportedFile" style="margin-top: 10px; padding: 5px; width: 600px;
                       	background: #efefef; border: 1px dashed #cdcdcd; color: 666666;">
                       	Exported status.</div>
                   	<br />
                   	<input value="Export to JPG" type="button" onclick="JavaScript:exportChart('JPG')" />
                   	<input value="Export to PNG" type="button" onclick="JavaScript:exportChart('PNG')" />
                   	<input value="Export to PDF" type="button" onclick="JavaScript:exportChart('PDF')" />
               	</center>
           	</div>
           	<div class="clear">
           	</div>
           	<p>
               	 </p>
           	<p class="small">
               	Right click on the chart to accee various export options or click any of the buttons
               	below</p>
           	<div class="underline-dull">
           	</div>
       	</div>
   	</div>
   	<div id="footer">
       	<ul>
           	<li><a href="../Default.aspx"><span>« Back to list of examples</span></a></li>
           	<li class="pipe">|</li>
           	<li><a href="../NoChart.html"><span>Unable to see the chart above?</span></a></li>
       	</ul>
   	</div>
</div>
</form>
</body>
</html>


Share this post


Link to post
Share on other sites

Have you tried creating a Virtual directory within IIS for where the exportHandler is located and using that path in the exportHandler setting? You might also want to make sure the correct permissions are granted on the directory for the ExportHandler to IIS's built-in users.

 

That's my 2-cents' worth :^)

 

Steve

 

No one???? No help on this???:(

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