Solved

printing control

Posted on 2002-07-08
8
241 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no 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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

813 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

14 Experts available now in Live!

Get 1:1 Help Now