Solved

How to print datas only from a form?

Posted on 1998-11-09
3
144 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
[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
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Reconfigure Delphi Install? 2 65
How to debug For loops? 3 63
control image tags in a string ? 12 153
Convert MS Word document to a PDF file 9 115
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

733 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