473,473 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

making a graph in excel format with C++

I need some help to generate with a C++ programm a file in Excel format
(or at least in a way that all the information in it can be read by
Excel) containing a graph with the data I choose. As an example I
include a simple script that generates an output file with two columns
of integers and I` d like to add in it a graph in the same file so that
when you open the output file aaa.xls with Excel both the numrical data
and graph are present.

Thanks,
George
#include <fstream>

using namespace std;

int main()

{

double a[10]= {1,2,3,4,5,6,7,8,9,10};

double b[10]= {11,12,13,14,15,16,17,18,19,20};

ofstream fout;

fout.open("aaa.xls");

int n= 0;

for(n= 0; n< 10; n++)

{

fout<< a[n]<<"\t"<<b[n]<<endl;
}

fout.close();

return 0;

}

Jul 22 '05 #1
1 2349
<ge******@libero.it> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com
I need some help to generate with a C++ programm a file in Excel
format (or at least in a way that all the information in it can be
read by Excel) containing a graph with the data I choose. As an
example I include a simple script that generates an output file with
two columns of integers and I` d like to add in it a graph in the
same file so that when you open the output file aaa.xls with Excel
both the numrical data and graph are present.

Thanks,
George
#include <fstream>

using namespace std;

int main()

{

double a[10]= {1,2,3,4,5,6,7,8,9,10};

double b[10]= {11,12,13,14,15,16,17,18,19,20};

ofstream fout;

fout.open("aaa.xls");

int n= 0;

for(n= 0; n< 10; n++)

{

fout<< a[n]<<"\t"<<b[n]<<endl;
}

fout.close();

return 0;

}

This is Microsoft specific and off-topic here.

Excel can read text files, but I strongly suspect that if you want to do
anything more sophisticated, then you have a lot of learning ahead of you.

Search for information on MSDN and/or seek further assistance in the
microsoft.public.* heirarchy.

microsoft.public.office.developer.automation
microsoft.public.office.developer.binary.file_form at

might be relevant --- or might not.
--
John Carson
1. To reply to email address, remove donald
2. Don't reply to email address (post here instead)

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: David W. Fenton | last post by:
Is MS Graph really completely useless in Access 97? I uninstalled and re-installed to get the Office 97 version of MS Graph, but I see no way whatsoever to insert dynamic data into the chart....
1
by: PeteCresswell | last post by:
The following code is working for everything but the column formatting on lines 9191 and 9192. It doesn't trap out - just doesn't "take". "fChart" is a pointer to the open form that has the...
1
by: Robin Tucker | last post by:
Hi, I am embedding various things into a Microsoft Word document. I want to embed and automate a chart control. I can embed an Excel.Chart.8 into my Word document manually (no problemo), but...
3
by: metalimi | last post by:
Hello, Let me start off by saying I am not the best C++ program in the world(and probablly in the room). I have been tasked to take a histogram and put it into a 2D graph in EXCEL. I have looked...
6
by: Esha | last post by:
I was asked by my boss to create representation of data by Graphs in VB 6 application. I checked the features of VB6 Graph control as well as Excel graphs. They are not good enough. I tried to...
1
by: Herbert Chan | last post by:
Hello, I'm subscribing to funds on HSBC, and the fund prices can be found here: http://www.tools.hsbc.com.hk/search/mpf?id=hk+mpf+fundsearch&lang=en&init=true At the moment, I'm copying each...
5
by: Narendar123P | last post by:
Hi all, I am trying to plot a graph in excel file using C#.Net. I am using the name space excel . If my graph has one series(2 columns), i am able to draw the graph. if my graph has two series(4...
0
by: naish | last post by:
Hi, My code drawing a graph in excel sheet. There one colum for lower pressure and another one for upper pressure. Any howi can draw a series for one pressure but i am not able to draw two series...
1
by: supermanii | last post by:
Hi everybody, I have a problem in vb6 code. I would like to make a chart on excel file with vb and I can make it with this code. With oChart .SeriesCollection.NewSeries ...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.