Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

printing control

Posted on 2002-07-08
8
Medium Priority
?
248 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 54

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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 3

Accepted Solution

by:
PNJ earned 800 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:Alon Hirsch
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 54

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

926 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