Solved

How to print datas only from a form?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
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…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

929 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

9 Experts available now in Live!

Get 1:1 Help Now