Solved

printing control

Posted on 2002-07-08
8
238 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 49

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
 
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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 49

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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 …
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…
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…
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…

708 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

15 Experts available now in Live!

Get 1:1 Help Now