Solved

Export to excel using Borland c++ Builder

Posted on 2003-10-30
4
2,114 Views
Last Modified: 2008-10-23
Hi there all,
I would like to export query results to excel.
A short example would be nice though or
components that I can use.

Exporting a grids data to excel can also work.

I geuss I can't say more than that

Thanks

0
Comment
Question by:morees
4 Comments
 
LVL 17

Accepted Solution

by:
rstaveley earned 25 total points
ID: 9648835
It is easiest to create a .csv file, which you can import into Excel:

--------8<--------
#include <fstream>

int main()
{
    std::ofstream out("myfile.csv");

    // Field names conventionally go at top (not mandatory)
    // columns are separated by commas
    // Strings are quoted (need to double up " to put quotes into strings)
    out << "\"Name\",\"Height\",\n";

    // Here's a row:
    out << "\"Fred\","  
          << 6.2 << ','   // Numbers aren't quoted
          << '\n';

    out.close();
}
--------8<--------
0
 
LVL 6

Assisted Solution

by:GloomyFriar
GloomyFriar earned 25 total points
ID: 9648848
There is the TExcelApplication component in Delphi (ver >4). I think the builder has the same component.
I've put some comments here:

http://oldlook.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20780602.html
0
 
LVL 9

Expert Comment

by:tinchos
ID: 10546313
No comment has been added lately, so it's time to clean up this question.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: rstaveley {http:#9648835} & GloomyFriar {http:#9648848}

Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Tinchos
EE Cleanup Volunteer
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now