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
Solved

printing control

Posted on 2002-07-08
8
242 Views
Last Modified: 2013-05-28
hi,

i would like to print bills using dot matrix printer (epson 1121) and the paper used is 8x6. the bill should look like this:

           - Company Name and Address -


Bill No: 00010                      Date:  08/07/2002
Customer Name: Sam                    
Credit Card No: -

Item Item         Quantity     Unit    Price    Ref
Code Description               Price
---------------------------------------------------------
0001 Beer               10      5.00   50.00    -
0003 Pineapple Juice     2      8.50   17.00    -










---------------------------------------------------------
                         Total Order   67.00  
                        Room Charges   80.00
                            Discount  (47.00)
                Service Charge (@10%)  10.00
                      Govt. Tax (@5%)   5.00  
                         --------------------------------
                          GRAND TOTAL 115.00  
                         --------------------------------
                                   

to print the bill in this layout, i use Printer.Print strPrint where strPrint is the variable that carries the above bill values.

the printing can be performed just like the layout. but i have a problem here, after finished printing, the printer will load the paper out as if it is A4 size paper and it is not suppose to be like that. what is wrong with it? is it because of the code, or the setting in the printer?


0
Comment
Question by:allicia
8 Comments
 

Expert Comment

by:X14h
ID: 7139863
try setting the printer papersize :

'User defined paper size
printer.papersize = vbPRPSUser

'Height and Width is measured in twips
'1 inch = 1440 twips
printer.height = 11520  
printer.width = 8640


hope that this will help

regards,

X14h
0
 
LVL 50

Expert Comment

by:Ryan Chong
ID: 7140086
Is your Data data-based? Why not just create the reports to print out the bills? You can try use the built-in Data Report in VB6 to generate a report.

regards
0
 

Author Comment

by:allicia
ID: 7140144
how to use the built-in data report?
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 3

Accepted Solution

by:
PNJ earned 200 total points
ID: 7140366
Check also that the printer DIP switches (or control panel) specify the correct paper length. Sometimes the printer driver will send out a form-feed to move the paper the next form (on Printer.NewPage or .EndDoc) and the printer tracks how much has already been printed - it uses its own settings to determine how far to advance the paper - hence you can get a mismatch between the Windows driver and the printer.
0
 
LVL 4

Expert Comment

by:AlonHirsch
ID: 7140503
PNJ is correct.
Most dot matrix printers have DIP switches that allow you to specify the page height.
You would need to change the DIP switch to reflect the paper size you require.

When you issue a Printer.EndDoc or Printer.NewPage, the printer driver physically sends a Form-Feed sequence to the printer. The printer will then move the paper however far it needs to until it reaches the top of the next page as defined by the DIP switches.

Some printers allow software control of these settings.

HTH,
Alon
0
 

Expert Comment

by:GautamMukherjee
ID: 7140589
In your printer just putt of the setting of Auto Tear off then it will not act like this. If Auto tear off is set on then it forwards the paper few inch after printing is complete if you dont wann that then change that setting.
0
 
LVL 50

Expert Comment

by:Ryan Chong
ID: 7142713
> how to use the built-in data report?
You need to create the Data Environment first, then try add the Data Report. You may try search the key word like: Data Environment or Data Report in MSDN to see the futher helps.

regards
0
 

Author Comment

by:allicia
ID: 7145003
yeah, you are right.
it's the driver's problem. after changing the paper type to user-defined, it works just fine.

thanks!
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB6 Compile Compatibility Issue 4 114
to transfer string from C lanaguage to VBA 4 70
VBA filters 2 64
Set email body to html using vbscript 6 49
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

808 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