Actually quite easy... let's say
procedure TForm1.PrintPurchase
var
MyFile: TextFile;
begin
AssignPrn(MyFile);
Rewrite(MyFile);
Writeln(MyFile, member name);
Writeln(MyFile, member address);
for i := 1 to (NumberOfPurchasedItems) do
Writeln(MyFile, ItemCode + ' ' + PurchasePrice + ' ' +
PurchaseQuantity);
Writeln(MyFile, PurchaseTotal);
System.CloseFile(MyFile);
end;
Everytime a purchase need to be printed you will call this procedure, I
think now you can customize the procedure to your needs. Is this what you
wanted?
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] Behalf
Of soonhuat ong
Sent: Tuesday, August 02, 2005 1:04 PM
To: [email protected]
Subject: RE: [delphi-en] Free Printing component
OK . Let's imagine a CD Selling system. Each time a member purchase an item,
i want the system to print the member's name, address, purchase item,
purchase qty, purchase price etc. The transaction will go on and on and on
(probably until the operator end his session of work. That's basically all i
want ...
Vahan Yoghoudjian <[EMAIL PROTECTED]> wrote: I don't see where's the
problem in that... you just send to the printer
what you want to print then close the file. But I see here that you want
more than simple plain text printing, don't you want some formatting on your
printouts a nice design? if the printout is complicated you should go for
some report components.
Delphi has the quick report library as standard reporting tool... you
might want to take a look at it, as for me I use Report Builder components,
excellent reporting tools but not free.
There are also Rave Reports, Crystal Reports I don't know if they are
free or not, maybe you might want to take a look at them.
If you want to print sequential lines as plain text without a format,
then this method should work fine with you, maybe if you tell me what do you
print exactly when, I might help you to Close the file. :)
Good luck
Vahan
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] Behalf
Of soonhuat ong
Sent: Tuesday, August 02, 2005 12:37 PM
To: [email protected]
Subject: RE: [delphi-en] Free Printing component
Your code works fine ..
But what i want is slightly different to this case.
For your info, each time a transaction has been done, i want it to print at
1 line. So we will never know when to call the System.CloseFile(MyFile)
function .
For example, each time a purchase is done, i want the system to print a line
of purchase information such as customoer name, price etc ...
Vahan Yoghoudjian <[EMAIL PROTECTED]> wrote:
If you want to print only plain text exactly like you told, you can open
the printer port and write directly into it
procedure TForm1.Button1Click(Sender: TObject);
var
MyFile: TextFile;
begin
AssignPrn(MyFile);
Rewrite(MyFile);
for i := 1 to 5 do
Writeln(MyFile, (Format 'This is Line %d',[i]));
System.CloseFile(MyFile);
end;
Vahan
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] Behalf
Of soonhuat ong
Sent: Tuesday, August 02, 2005 10:45 AM
I want a free component that can help me to print the data line by line as
the following example:
var myprintstring : String;
for i := 1 to 5 do
begin
myprintstring := 'This is Line ' + IntToStr(i);
// Print data here
end;
So the output will looks something like this:
Output
-------
This is Line 1
This is Line 2
This is Line 3
This is Line 4
This is Line 5
Anyone can help me out ?
---------------------------------
Start your day with Yahoo! - make it your home page
[Non-text portions of this message have been removed]
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
----------------------------------------------------------------------------
----
YAHOO! GROUPS LINKS
a.. Visit your group "delphi-en" on the web.
b.. To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
----------------------------------------------------------------------------
----
[Non-text portions of this message have been removed]
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
SPONSORED LINKS
C programming language Computer programming languages The c programming
language C programming language List of programming languages Delphi
programmer
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "delphi-en" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[Non-text portions of this message have been removed]
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
----------------------------------------------------------------------------
----
YAHOO! GROUPS LINKS
a.. Visit your group "delphi-en" on the web.
b.. To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
----------------------------------------------------------------------------
----
[Non-text portions of this message have been removed]
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
SPONSORED LINKS
C programming language Computer programming languages The c programming
language C programming language List of programming languages Delphi
programmer
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "delphi-en" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
---------------------------------
Start your day with Yahoo! - make it your home page
[Non-text portions of this message have been removed]
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
SPONSORED LINKS C programming language Computer programming languages The
c programming language
C programming language List of programming languages Delphi
programmer
----------------------------------------------------------------------------
----
YAHOO! GROUPS LINKS
a.. Visit your group "delphi-en" on the web.
b.. To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
----------------------------------------------------------------------------
----
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a
href="http://us.ard.yahoo.com/SIG=12hhouvqh/M=362329.6886308.7839368.1510227/D=groups/S=1705115362:TM/Y=YAHOO/EXP=1122988537/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~->
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/