Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Export to excel using Borland c++ Builder

Posted on 2003-10-30
4
Medium Priority
?
2,302 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 17

Accepted Solution

by:
rstaveley earned 75 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 75 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
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.

670 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