Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing from string grid?? 2

Status
Not open for further replies.

Jonah86

Programmer
Dec 11, 2003
152
US
I have a string grid that I'm using to hold records that were selected by a user. I need to print the grid when the user is done selecting all of their items. What would be the best way to print the grid? I've not done any printing outside of using the Rave report tool...which would not work for my needs here.

Thanks for the help!
 

You can use some basic components to do this:-
A print dailog
A font selectpor dilaog
Very basicly:-
Code:
 if printdialog.execute then
      with printer.canvas do
        begin
           Font := FontDialog.Font;
           printer.begindoc;
           Textout(100,0,'YOUR TEXT');
           printer.enddoc
        end;
There are several more printer commnads , also you need to include 'Printers' in your uses clause
Just stick in the values from your string grid. instead of your text, the values of textout are the row and col positions.


Steve
Those who know me have no need of my name. SD
 
Very cool, seems to work great! Thanks a lot!
 
One other question. Is there any way to force the printer to print landscape by default from the program? I know you can set it in the dialog but let's face it, how many users are going to remember to do that?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top