Solved

Export to excel using Borland c++ Builder

Posted on 2003-10-30
4
2,164 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 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Quicksort a dynamic deque 33 79
SetCurrentDirectory path limit 7 144
C language IDE – Compilers installation 14 78
Can Live bindings change TGrid Cell Colour ? 1 29
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

740 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