Solved

printing control

Posted on 2002-07-08
8
244 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
[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
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 52

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
Independent Software Vendors: 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!

 
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 52

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

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.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

696 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