Google Answers Logo
View Question
 
Q: visual basic 6.0 - need to print DataGrid ( No Answer,   2 Comments )
Question  
Subject: visual basic 6.0 - need to print DataGrid
Category: Computers > Programming
Asked by: chris2002micrometer-ga
List Price: $4.00
Posted: 22 Jul 2002 12:45 PDT
Expires: 21 Aug 2002 12:45 PDT
Question ID: 43827
How can I print the contents as shown (wysiwyg) of a DataGrid object.
Is there a way to hook it up with a DataReport object?

Clarification of Question by chris2002micrometer-ga on 23 Jul 2002 05:57 PDT
PaintPicture won't suffice. I need ASCII for character printer.
Answer  
There is no answer at this time.

Comments  
Subject: Re: visual basic 6.0 - need to print DataGrid
From: patangay-ga on 24 Sep 2002 18:03 PDT
 
Private Sub cmdPrint_Click()     'For Print

  On Error GoTo err_print
  With CommonDialog1
  .Copies = 1
  .Flags = &H0&  
  .ShowPrinter
  For i = 1 To CommonDialog1.Copies
      Printer.Print Form2.DataGrid1
      Printer.NewPage
  Next i
 Printer.EndDoc
 On Error GoTo 0
 Exit Sub

err_print:

  On Error GoTo 0
  Exit Sub
  End With

End Sub
Subject: Re: visual basic 6.0 - need to print DataGrid
From: chris2002micrometer-ga on 25 Sep 2002 15:25 PDT
 
Dear patangay-ga,
First of all, thank you very much for your comment on my expired
question. I'd like to slip you the 4 bucks somehow. I pasted the code
and (of course) had to adapt a few things to fit my code. It almost
works, but I am only getting a blank page feed. The code is now:

 On Error GoTo err_print
  With CommonDialog1
  .Copies = 1
  .Flags = &H0&
  .ShowPrinter
  For i = 1 To CommonDialog1.Copies
      Printer.Print frmFtab1.grdDataGrid      //.Text
// I tried a few suffixes here like rows, headings, text, etc. but I
am not getting the content to print without a suffix. The table, of
course, has plenty of rows in it.
      Printer.NewPage <--- this works fine
  Next i
 Printer.EndDoc
 On Error GoTo 0
 Exit Sub
 
err_print:
 
  On Error GoTo 0
  Exit Sub
  End With

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy