Results 1 to 2 of 2

Thread: DB Grid Question

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    Wellington NZ
    Posts
    153

    Angry

    I have a problem printing a DB Grid, and have know idea how to do it, i need the print out to be displayed in a presentable format and show all the data generated. Is it possible to export the data into Excell and produce a print out from there?

    Rohan

  2. #2
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696

    Talking

    Yes you can export it to excel. First set up a recordset that mimicks the dbgrid. then go to the refernce section of VB and find the Microsoft excel object collection. Set a variable up to a new excel application and open a new workbook and loop through the recordset filling out the various fields. Then finally do a workbook.print

    If you need to no more information on the excel object, use the below links.

    http://msdn.microsoft.com/library/of...ce97/SF743.htm
    http://msdn.microsoft.com/library/of...tionobject.htm




    You can probably do it with just the dbgrid, but I haven't used one for such a long time that I can't remember

    Hope this helps

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width