CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 1999
    Location
    Pune - Maharashtra - India
    Posts
    6

    Form Printing on Dot Matrix Printer

    I have a form having a few labels and text boxes.
    I need to print this form on a dot matrix printer in text mode only (for speed). This printer does not suppport screen fonts. I am using a generic text printer driver for my default printer. When I use form.printform method I do not get the print. Can someone guide me how to do this ? (My customer doesnot allow me to use a page printer such as a laser printer for this purpose)

    Thanks


  2. #2
    Join Date
    Sep 1999
    Location
    Red Wing, MN USA
    Posts
    312

    Re: Form Printing on Dot Matrix Printer

    The whole point of a TextOnly Driver/Printer Mode, is that it will print Only Text.

    If you want to print a Graphic of the Form, you need to Install the Driver for the DotMatrix Printer and Print using that Driver. You can always set the Quality to Draft for increased speed.

    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]
    Aaron Young
    Senior Programmer Analyst (Red Wing Software)
    Certified AllExperts Expert

  3. #3
    Join Date
    Sep 1999
    Location
    Baytown, TX, United States
    Posts
    23

    Re: Form Printing on Dot Matrix Printer

    Here's something that may help you. Notice the last statement. This is the most important. You MUST enter this every time. It doesn't matter where you send the print focus. In your case, you would have to send it to a label or text box. You can do that. When you want to Print the form, under Print options: select "Current Project" and "Form as Text".

    Private Sub cmdPrint_Click()
    'hide command buttons before printing the form
    cmdCalc.Visible = False
    cmdPrint.Visible = False
    cmdClear.Visible = False
    cmdExit.Visible = False
    'display command buttons after the form is printed
    cmdCalc.Visible = True
    cmdPrint.Visible = True
    cmdClear.Visible = True
    cmdExit.Visible = True
    cmdClear.SetFocus

    kazooie21

  4. #4
    Join Date
    Sep 1999
    Location
    Baytown, TX, United States
    Posts
    23

    Re: Form Printing on Dot Matrix Printer

    Under the Print command Click event procedure, you have to type this line in:

    Print.Form or PrintForm

    Under one of the label or text boxes, you have to type this in:

    cmdPrint.SetFocus

    kazooie21

  5. #5
    Join Date
    Oct 1999
    Location
    Pune - Maharashtra - India
    Posts
    6

    Re: Form Printing on Dot Matrix Printer

    Exactly ! I want to print the text on the form such as the one inside a text box and label only. My form does not have any graphic onto it neither do I want to print any graphic.

    Any suggestions ?



  6. #6
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Form Printing on Dot Matrix Printer

    How abt, write the contents of texts and labels to a text file and dump that tmp file to printer!!.

    RK

  7. #7
    Join Date
    Oct 1999
    Location
    Pune - Maharashtra - India
    Posts
    6

    Re: Form Printing on Dot Matrix Printer

    Yes ! That is what I have done eventually. My form print also needs some formatting. Various text fields are to be placed on to the paper at specific positions. So I had to make a text file template with tokens such as [#1#] to be replaced with actual data.

    However, I want a method by which my graphic design in the form (only layout of fields and text within them; not the graphic content) would bet translated to its "text only" version. Maybe using top, left properties of text boxes being used for placement of fields etc.

    (I know that the text mode stands outdated as such ; but my customer insists on low cost solution (esp. per copy cost) for daily printing of such a form in large quantities. Priting the same form in graphic mode is taking a lot of time. )

    Thanks




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

Featured