Exporting data to Excel worksheet
-
Hello guys, Consider I have some text data(maybe a Microsoft Access database *.mdb file too), and I want to save them as Microsoft Excel file. How can I achieve that ? thanks. PS. I have MFC Dialog based Application
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
-- modified at 9:25 Saturday 4th February, 2006 -
Hello guys, Consider I have some text data(maybe a Microsoft Access database *.mdb file too), and I want to save them as Microsoft Excel file. How can I achieve that ? thanks. PS. I have MFC Dialog based Application
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
-- modified at 9:25 Saturday 4th February, 2006 -
Hello guys, Consider I have some text data(maybe a Microsoft Access database *.mdb file too), and I want to save them as Microsoft Excel file. How can I achieve that ? thanks. PS. I have MFC Dialog based Application
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
-- modified at 9:25 Saturday 4th February, 2006You might want to save the data in Comma Separated Variable (csv) format. Excel can open csv format files directly. For instance:
int value1 = 20;
int value2 = 32;
float value3 = 10.3f;
FILE* myFile;
myFile = fopen("c:\\temp\\foo.csv", "wt");
if(myFile)
{
fprintf(myFile, "%d, %d, %.1f\n", value1, value2, value3);
}
fclose(myFile);Graham
-
You might want to save the data in Comma Separated Variable (csv) format. Excel can open csv format files directly. For instance:
int value1 = 20;
int value2 = 32;
float value3 = 10.3f;
FILE* myFile;
myFile = fopen("c:\\temp\\foo.csv", "wt");
if(myFile)
{
fprintf(myFile, "%d, %d, %.1f\n", value1, value2, value3);
}
fclose(myFile);Graham
-
Hello guys, Consider I have some text data(maybe a Microsoft Access database *.mdb file too), and I want to save them as Microsoft Excel file. How can I achieve that ? thanks. PS. I have MFC Dialog based Application
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
-- modified at 9:25 Saturday 4th February, 2006I use this one since a long time. You're able to modify it like you want. http://www.codeproject.com/printing/testexcel.asp
-
I use this one since a long time. You're able to modify it like you want. http://www.codeproject.com/printing/testexcel.asp
meinhard_risch wrote:
Good link, thanks :)
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill