Link to home
Start Free TrialLog in
Avatar of lulu50
lulu50Flag for United States of America

asked on

Export data and graph to excel

Hi,

I need your help.

How can I when document ready to export the data with the graph to excel?

this is what I have

I want the output to be displayed in the excel document.

Thanks,
Lulu

	<style type="text/css">
		.highchart { display:none; }
		.container
		{
			width:500px;
			float:left;
			margin: 30px;
			padding:10px;
			background-color:#eee;
			-webkit-box-shadow: 0px 1px 15px rgba(50, 50, 50, 0.75);
			-moz-box-shadow:    0px 1px 15px rgba(50, 50, 50, 0.75);
			box-shadow:         0px 1px 15px rgba(50, 50, 50, 0.75);
		}
		#parent
		{
			margin-left:7%;
			margin-bottom:10%;
		}
	</style>
	
	<!---
		loading jQuery and jQuery UI javascript,
		with highchartTable plugin
	--->
	
	<script src="../Script/ChartInExcel/jquery.min.js" type="text/javascript"></script>
	<script src="../Script/ChartInExcel/jquery-ui.min.js" type="text/javascript"></script>
	<script src="../Script/ChartInExcel/highcharts.js" type="text/javascript"></script>
	<script src="../Script/ChartInExcel/jquery.highchartTable.js" type="text/javascript"></script>
	<script src="../Script/ChartInExcel/exporting.js" type="text/javascript"></script>
	
	<script type="text/javascript">
		/*
			jQuery document ready
			The HighchartsTable plugin takes data
			and attributes from a table
			and parses them to simply create an Hight-charts chart
		*/
		$(document).ready(function()
		{
			/*
				simply call highchartTable on a selector
				that selects the prepared table. Like this : 
			*/
			$('table.highchart').highchartTable();
		});
	</script>
</head>
<body>
	<h1 style="text-align:center;">How to create pure HTML5 chart using jQuery</h1>
	
	<!--
		chart generated and placed into below divs.
		which defined into tables data-graph-container attributes
	-->
	<div id="parent">
		<div class="highchart-container container"></div>
		<div class="highchart-container_first container"></div>
		<div class="highchart-container_second container"></div>
		<div style="clear:both;"></div>
	</div>
	
	<table class="highchart" data-graph-container=".highchart-container" data-graph-type="pie">
		<thead>
			<tr>
				<th>Month</th>
				<th>Sales</th>
				<th>Benefits</th>
			</tr>
		</thead>
		<tbody>
			<tr>
			  <td>January</td>
			  <td>8000</td>
			  <td>2000</td>
			</tr>
			<tr>
			  <td>February</td>
			  <td>12000</td>
			  <td>3000</td>
			</tr>
			<tr>
			  <td>March</td>
			  <td>18000</td>
			  <td>4000</td>
			</tr>
			<tr>
			  <td>April</td>
			  <td>2000</td>
			  <td>-1000</td>
			</tr>
			<tr>
			  <td>May</td>
			  <td>500</td>
			  <td>-2500</td>
			</tr>
		</tbody>
	</table>
	
	
	
	

Open in new window

Avatar of Rob
Rob
Flag of Australia image

You can have Excel pull the data in from the same place the jquery gets it if it is dynamically loaded on the webpage and have Excel render the graph.

Or you can use the "From Web" under the "Data" tab to select the table on your webpage
Avatar of lulu50

ASKER

I've requested that this question be deleted for the following reason:

Incorrect answer.
What was incorrect?
Avatar of lulu50

ASKER

Rob,

"You can have Excel pull the data in from the same place the jquery gets it"
I don't know what you are talking about. You said I can do but how ? I need an either an example or show me what I am doing wrong.

"you can use the "From Web" under the "Data" tab to select the table on your webpage"
what From Web are you talking about that I can select the table.

I don't understand anything you said.  

Please provide either an example or look at my code.  

Thanks for trying to help but again I am not getting what you are saying unless I see some examples.
The chart in your example is generated by javascript and it is not able to be directly converted to excel.  What you need to do is link Excel to the same underlying data that highcharts uses and have Excel create the graph.

In otherwords, in Excel:

User generated image
User generated image
User generated image
Avatar of lulu50

ASKER

I think you have missed understand me.
because you are showing me how to generate a graph in excel which something I did not ask for.

My question was how to do it in coldfusion, and your example does not provide me with a correct result.

I don't want to know how to generate a chart in excel, what i want is how to generate a coldfusion code that would export the data to excel and generate a report.

It is totally different thing.

Thank you for trying but that's not what I meant or what I want.
Avatar of lulu50

ASKER

I've requested that this question be deleted for the following reason:

I did not find a solution to my question
ASKER CERTIFIED SOLUTION
Avatar of Rob
Rob
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lulu50

ASKER

Rob,

Yes, I now agree with you.

It is my fault for not including the word Coldfusion.  I thought I did but looking at the question above I don't see the word Coldfusion.

It is not your fault that I did not get the correct answer.

so, I will give you the credit for it.

You are a great fighter let me tell you. (You do not give up not bad)

You should be a lawyer or something you just don't give up.

It is a good thing, keep it up Rob lol lol lol

You win :-)

I just want to Thank you for all your help,

I do appriciate everyone that have helped millions of users here.

I Thank you again and again and next time I'll make sure to give more details to what I'm trying to accomplished.

Lulu
Avatar of lulu50

ASKER

Thanks,
Thanks Lulu for all the kind words :)  

I do understand how frustrating it can be not getting the answers you need.

I hope that you can get an answer in Coldfusion soon!

Cheers,

Rob