Solved

How to print datas only from a form?

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

Industry Leaders: 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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

705 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