making a graph in excel format with C++

G

george_y

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;

}
 
J

John Carson

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_format

might be relevant --- or might not.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top