Solved

How to print datas only from a form?

Posted on 1998-11-09
3
141 Views
Last Modified: 2010-04-04
Can u please tell me how to print the details(data) from a form without printing the whole form?
E.G. after I entered details(data) into a form I need the details(data) to be printed out only not the whole form.

Please email me at xkuma@hotmail.com
0
Comment
Question by:xkuma
3 Comments
 
LVL 1

Expert Comment

by:zac
ID: 1346259
If you want to lay out the data in a nice way I would recommend you use quick reports.  It saves a lot of time and is really quite easy to use for simple layouts.

If you want any further info about QR msg me here.

Cheers,

Zac
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1346260
What is it exactly you want to print? -What data you have on the form?
0
 
LVL 17

Accepted Solution

by:
inthe earned 100 total points
ID: 1346261
hello,
i had the same trouble a while back but this is how i found out to do it :basically you create a stringlist and assign or add items to it like edit1.text or combobox1.text ,memo1.lines etc:
ive added the basic code below so you'll see what i mean .
InThe

procedure TMainFrm.ToolButton9Click(Sender: TObject);
var
 StringList: TStrings;
   TempStr : String;
     FName : String;
       P,F : TextFile ;
         z:string;
       begin
      z:=MainFrm.Caption;
   StringList := TStringList.Create;
  try
    with StringList do begin
      Add('¢¢¢¢¢¢¢¢¢'+ z +'¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢');
      Add('¢');
     Add('¢ ');
      Add('¢ ');
      Add('¢ ');
      Add('¢ Machine................'+ Edit1.text);
      Add('¢ Location...............'+ Combobox3.text);
      Add('¢ Part...................'+ Combobox2.text);
      Add('¢ Item...................'+ Combobox4.text);
      Add('¢ Amount Left In Stock...'+ eamount.text);
      Add('¢ ');
      Add('¢ Supplier..........'+ Combobox5.text);
      Add('¢ Order Number......'+ Combobox10.text);
      Add('¢ Contact...........'+ Combobox7.text);
      Add('¢ Price.............'+ Combobox6.text
    end;

    with ComboBoxtoprint do begin
      Items.Assign(StringList);
      items.savetofile('vis.pnt');
     end;
  finally
    StringList.free;
  Fname:=OpenDialog3.FileName; {vis.pnt}
  AssignFile(F,FName);
   Reset(F);
    AssignPrn(P);
   ReWrite(P);
  Printer.Canvas.Font.Name:='Courier New';
 Printer.Canvas.Font.Size:=14 ;
   While Not Eof(F)Do Begin
 Readln(F,TempStr);
  Writeln(P,TempStr);
 End;
  CloseFile(F);
 CloseFile(P);
 DeleteFile(FName);
end;
end;
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video discusses moving either the default database or any database to a new volume.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

758 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

19 Experts available now in Live!

Get 1:1 Help Now