Sign in to follow this  
devi

Problem In Exporting Chart As Pdf And Image In Jsf

Recommended Posts

Hi all,

 

I am try to export my chart as pdf and image. I am using client side exporting.

 

Here is my code:

 

 

 

                				<script src="#{email['web_url']}/graphs/JSClass/FusionCharts.js" type="text/javascript"></script>
                             	<script src="#{email['web_url']}/graphs/new/Charts/FusionChartsExportComponent.js" type="text/javascript"></script>

                               	<div id="campaigncomparediv"></div>

								<h:panelGroup rendered="#{campaignsummaryreport.campaignReportSummaries.size gt 0}">

                  				<script type="text/javascript" language="Javascript">

                                   	//<![CDATA[
						             var chart = new FusionCharts("#{email['web_url']}/graphs/new/Charts/MSColumnLine3D.swf", "1", "900", "400","0","1");
						             chart.addParam("WMode", "Transparent");
						             chart.setDataURL("/mtc/reports/campaigncomparegraph.seam");       	
						             chart.render("campaigncomparediv");
						             //]]>

					                 	</script>

						             <div id="fcexpDiv"></div>

                            			<script type="text/javascript" language="Javascript">
							             //<![CDATA[
										var myExportComponent = new FusionChartsExportObject("fcExporter1", "#{email['web_url']}/graphs/new/Charts/FCExporter.swf");
										myExportComponent.Render("fcexpDiv");
							             //]]>

										</script>
					             </h:panelGroup>

In comparecampaign.seam file i specified as follows,

  
                           	<graph xAxisName='Name' yAxisName='  Rates'   palette='2' rotateNames='0' animation='1' bgcolor = 'FFFFFF' AlternateHGridColor='#87CEFA' 	divLineColor='#808080' numdivlines='10' useRoundEdges='0' legendBorderAlpha='0' divLineAlpha='10' labelDisplay='ROTATE' slantLabel='1' alternateHGridAlpha='5' showAlternateVGridColor='1' anchorAlpha='100' divLineDecimalPrecision='1' aboutMenuItemLabel='Treselle Systems' aboutMenuItemLink="N-http://www.treselle.com/" decimals='2'
 numberSuffix="%" plotSpacePercent='40' exportEnabled='1' exportShowMenuItem='1' exportAtClient="0" exportHandler="fcExporter1">

 

i am getting FCExporter.swf waiting image.

 

But while clicking "save as " any of option it starts to capture the data finally it shows 404 status error ( The requested resource (/mtc/reports/fcExporter1) is not available.

 

I am using jsf with seam. Please help me where i am going wrong.

 

Thanks in Advance. :rolleyes:

Share this post


Link to post
Share on other sites

Hi all,

 

I am try to export my chart as pdf and image. I am using client side exporting.

 

Here is my code:

 

 

 

    							<script src="#{email['web_url']}/graphs/JSClass/FusionCharts.js" type="text/javascript"></script>
                             	<script src="#{email['web_url']}/graphs/new/Charts/FusionChartsExportComponent.js" type="text/javascript"></script>

                               	<div id="campaigncomparediv"></div>

								<h:panelGroup rendered="#{campaignsummaryreport.campaignReportSummaries.size gt 0}">

      							<script type="text/javascript" language="Javascript">

                                   	//<![CDATA[
			                         var chart = new FusionCharts("#{email['web_url']}/graphs/new/Charts/MSColumnLine3D.swf", "1", "900", "400","0","1");
			                         chart.addParam("WMode", "Transparent");
			                         chart.setDataURL("/mtc/reports/campaigncomparegraph.seam");   		
			                         chart.render("campaigncomparediv");
			                         //]]>

		                             	</script>

			                         <div id="fcexpDiv"></div>

                						<script type="text/javascript" language="Javascript">
				                         //<![CDATA[
										var myExportComponent = new FusionChartsExportObject("fcExporter1", "#{email['web_url']}/graphs/new/Charts/FCExporter.swf");
										myExportComponent.Render("fcexpDiv");
				                         //]]>

										</script>
		                         </h:panelGroup>

In comparecampaign.seam file i specified as follows,

  
                           	<graph xAxisName='Name' yAxisName='  Rates'   palette='2' rotateNames='0' animation='1' bgcolor = 'FFFFFF' AlternateHGridColor='#87CEFA' 	divLineColor='#808080' numdivlines='10' useRoundEdges='0' legendBorderAlpha='0' divLineAlpha='10' labelDisplay='ROTATE' slantLabel='1' alternateHGridAlpha='5' showAlternateVGridColor='1' anchorAlpha='100' divLineDecimalPrecision='1' aboutMenuItemLabel='Treselle Systems' aboutMenuItemLink="N-http://www.treselle.com/" decimals='2'
 numberSuffix="%" plotSpacePercent='40' exportEnabled='1' exportShowMenuItem='1' exportAtClient="0" exportHandler="fcExporter1">

 

i am getting FCExporter.swf waiting image.

 

But while clicking "save as " any of option it starts to capture the data finally it shows 404 status error ( The requested resource (/mtc/reports/fcExporter1) is not available.

 

I am using jsf with seam. Please help me where i am going wrong.

 

Thanks in Advance. :rolleyes:

 

 

 

 

 

 

Hi all,

 

I solved this. I forgot to give "exportAction="save" " and i wrongly gave the exportAtClient attribute to "0" .

 

Now i changed that to "1" . Now successfully export the chart as pdf and image.

 

Thanks,

Devi.S

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