Results 1 to 18 of 18

Thread: [RESOLVED] printing problem ?

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2007
    Location
    Singapore
    Posts
    44

    Resolved [RESOLVED] printing problem ?

    Can anyone tell me why the following work in some PC but not work in some PC ? We use Window XP SP2 and printing to the same printer. Actually, two out of five PC can do the printing in "Courier" but another three PC can only print the output in "Draft".


    Code:
        Printer.FontName = "Courier"
        Printer.FontSize = 10
    Last edited by Sammie; Apr 5th, 2007 at 07:53 AM.

  2. #2
    Hyperactive Member snakeman's Avatar
    Join Date
    Aug 2006
    Posts
    351

    Re: printing problem ?

    hey
    can you write all the code?

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2007
    Location
    Singapore
    Posts
    44

    Re: printing problem ?

    snakeman,

    here is all the code:

    Code:
        Printer.FontName = "Courier"
        Printer.FontSize = 10
    '    Printer.Orientation = vbPRORLandscape
                    
        Printer.FontUnderline = False
        
        Printer.Print " "
        Printer.Print " "
        Printer.Print " "
        Printer.Print " "
        Printer.Print " "
        Printer.Print " "
        Printer.Print " "
        Printer.Print " "
        Printer.Print " "
        Printer.Print Tab(C2); LTrim(cmbClientName.Text)
        Printer.Print Tab(C1); LTrim(txtNoteNo)
        Printer.Print Tab(C2); LTrim(cmbInsurerName.Text)
        Printer.Print Tab(C1); LTrim(strAdd1); Tab(C2); txtClientCode
        Printer.Print Tab(C1); LTrim(strAdd2); Tab(C2); cmbAECode.Text
        Printer.Print Tab(C1); LTrim(strAdd3)
        Printer.Print Tab(C1); LTrim(strAdd4); Tab(C2); DateValue(Date)
        Printer.Print " "
        Printer.Print " "
        Printer.Print " "
        Printer.Print Tab(C1 + 12); LTrim(txtPolicy)
        Printer.Print " "
        Printer.Print Tab(6); cmbClass.Text; Tab(C1 + 12); LTrim(txtEndorsement); Tab(97); strFDD; Tab(103); strFMM; Tab(108); strFYY; Tab(115); strTDD; Tab(121); strTMM; Tab(126); strTYY
        Printer.Print " "
        Printer.Print Tab(C1 + 4); LTrim(cmbSumInsuredExchCode.Text) & LTrim(CStr(txtSumInsured))
        Printer.Print Tab(C1 + 4); LTrim(txtSumInsuredText)
        Printer.Print Tab(C1 + 4); LTrim(txtInsured); Tab(97); " "
        Printer.Print Tab(C1 + 4); LTrim(txtType); Tab(97); " "
        Printer.Print Tab(C1 + 4); " "; Tab(97); " "
        Printer.Print Tab(C1 + 4); " "; Tab(97); " "
        Printer.Print Tab(C1 + 4); " "; Tab(97); " "
        Printer.Print Tab(C1 + 4); " "; Tab(97); " "
        Printer.Print Tab(C1 + 4); " "; Tab(97); " "
        Printer.Print Tab(C1 + 4); " "; Tab(97); " "
        Printer.Print Tab(C1 + 4); " "
        Printer.Print Tab(C1 + 4); " "; Tab(C2 + 3); LTrim(cmbPremiumExchCode.Text) & LTrim(CStr(txtPremium))
        Printer.Print " "
        Printer.Print " "
        Printer.Print " "
        Printer.Print " "
        Printer.Print " "
        Printer.Print " "
        Printer.Print Tab(C1 + 3); LTrim(txtBrief)
        
        Printer.EndDoc

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: printing problem ?

    Do the other PCs have the Courier font installed?

    What are the other differences between the machines?

  5. #5

    Thread Starter
    Member
    Join Date
    Apr 2007
    Location
    Singapore
    Posts
    44

    Re: printing problem ?

    Hack,

    All PCs have Courier font but there are difference dated. I try to locate the difference between those two group of PC but I have no finding.

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: printing problem ?

    Then I would suspect there is your problem.

    Change the font to something else and see if the problem persists.

    Something like MS Sans Serif

  7. #7

  8. #8

    Thread Starter
    Member
    Join Date
    Apr 2007
    Location
    Singapore
    Posts
    44

    Re: printing problem ?

    MartinLiss,

    Yes, I did only copy the exe file to those PCs.

  9. #9
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: printing problem ?

    Then I'm surprised this is the only problem you are having. I would expect your program to blow up all over the place.

    You can't just copy the .exe to another PC.

    You need to build a formal installation and setup package, and formally install your program in order for it to work.

  10. #10

  11. #11

    Thread Starter
    Member
    Join Date
    Apr 2007
    Location
    Singapore
    Posts
    44

    Re: printing problem ?

    Hack,

    Would you give me more detail regarding on "formal installation" and "setup package". We developed this software in a junior school for use in the office, and we are not programmer.

  12. #12

  13. #13
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: printing problem ?

    VB comes with the Package and Deployment Wizard. You probably don't have that listed, so in order to load it, click Add-Ins/Add-In Manager

    Find "Package And Deployment Wizard" and click on it.

    Check the Loaded/Unloaded and Load At Startup checkboxes

    Click OK

    Save your project and compile it.

    Now, use the Package and Deployement Wizard to create your installation and setup package.

  14. #14

    Thread Starter
    Member
    Join Date
    Apr 2007
    Location
    Singapore
    Posts
    44

    Re: printing problem ?

    Hack,

    Thanks, I will try it tomorrow.

  15. #15
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: printing problem ?

    Just so you know
    Quote Originally Posted by Sammie
    Actually, two out of five PC can do the printing in "Courier" but another three PC can only print the output in "Draft".
    Courier is a font, Draft is a quality. You can print any font the printer can print in any quality the printer can print, as long as the computer has that font installed. It sounds as if 3 of the computers don't have the correct Courier font installed, which would be strange, since Courier is installed in Windows.

    Are you using the same printer, set up the same way, on all computers? (Or printing to the same networked printer in all cases?)
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  16. #16
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: printing problem ?

    You can also use OTHER packaging tools. Check the FAQ's in the Application Deployment Forum for available choices...

  17. #17

  18. #18

    Thread Starter
    Member
    Join Date
    Apr 2007
    Location
    Singapore
    Posts
    44

    Re: printing problem ?

    MartinLiss,

    It is the same network printer and all PC already have Courier font installed.

    We found out the cause to the problem and can overcome the problem, the PCs can print correctly is setup with "Region and Language" in Singapore. But the PCs cannot print correctly is setup with "Region and Language" in Taiwan.

    So the problem is sovled now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width