?
Solved

How to print datas only from a form?

Posted on 1998-11-09
3
Medium Priority
?
148 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 200 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 Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Integration Management Part 2
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month16 days, 19 hours left to enroll

864 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