?
Solved

Print an MSFlexGrid _and_ the form it's on

Posted on 2002-04-12
4
Medium Priority
?
241 Views
Last Modified: 2010-05-02
Hello all
I have some forms that have text and up to two different MSFlexGrids on them.
If I use PrintForm the Grids are black on our HP laserjets.  If I use the old Printer.PaintPicture grdDisputes.Picture, 0, 0, the data in the Grids prints fine, but obviously that doesn't print anything else but the grid.
SO, the points are for the code to a function (which'll be called from the form itself) that prints the form and the Grid, with the Grid data visible, not blacked out.

Thanks

v
0
Comment
Question by:vlg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 800 total points
ID: 6936986
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6936989
this is a duplicate question of http://www.experts-exchange.com/questions/Q.20288032.html.

please delete this one.
0
 
LVL 1

Expert Comment

by:surajdeo
ID: 6937032
hi,
 
 u can print using printer object, here i am giving one example, in which form is contaning textboxes, label datepicker and flexgrid and a button. if u r clicking print button all the data will be print.


Private Sub CmdPrint_Click()

       
        Printer.PaperSize = vbPRPSA4
        Printer.FontSize = 10
        Printer.FontBold = True
       
        Printer.CurrentX = 1000
        Printer.CurrentY = 1000
        Printer.Print "CustCode : " & VL_Int_CustCode

        Printer.CurrentY = 1000
        Printer.CurrentX = 4400
        Printer.Print "Date : " & dtpSalesDate.Value


        Printer.CurrentX = 1000
        Printer.CurrentY = 1500
        Printer.Print "BilNo : " & txtBilNo.Text


        Printer.CurrentX = 1000
        Printer.CurrentY = 2000
        Printer.Print "Patient : " & txtPatientName.Text

        Printer.CurrentY = 2000
        Printer.CurrentX = 4400
        Printer.Print "Pay Mode : " & cmbModeOfPay.Text


        Printer.CurrentX = 1000
        Printer.CurrentY = 2500
        Printer.Print "Doctor : " & txtDoctorName.Text

        Printer.CurrentY = 2500
        Printer.CurrentX = 4400
        Printer.Print "Sales Return : " & lblSReturn.Caption

                       
        Printer.CurrentX = 500
        Printer.CurrentY = 3200
       
        Dim i, cy, cx
        For i = 0 To MSFGSales.Rows - 1
            If i > 0 Then Printer.FontBold = False
           
            cy = Printer.CurrentY
            Printer.CurrentX = 1000
            Printer.Print MSFGSales.TextMatrix(i, 0)
           
            Printer.CurrentX = 1650
            Printer.CurrentY = cy
            Printer.Print MSFGSales.TextMatrix(i, 1)
           
            Printer.CurrentX = 2750
            Printer.CurrentY = cy
            Printer.Print MSFGSales.TextMatrix(i, 2)
           
            Printer.CurrentX = 5000 '4850
            Printer.CurrentY = cy
            Printer.Print MSFGSales.TextMatrix(i, 3)
           
            Printer.CurrentX = 6000 '5850
            Printer.CurrentY = cy
            Printer.Print MSFGSales.TextMatrix(i, 4)
           
            Printer.CurrentX = 7500 '7000
            Printer.CurrentY = cy
            Printer.Print MSFGSales.TextMatrix(i, 5)
           
            Printer.CurrentX = 8150 '7650
            Printer.CurrentY = cy
            Printer.Print MSFGSales.TextMatrix(i, 6)
           
            Printer.CurrentX = 9000 '8300
            Printer.CurrentY = cy
            Printer.Print MSFGSales.TextMatrix(i, 7)
            If i >= 0 Then Printer.CurrentY = Printer.CurrentY + 300
        Next i
       
        Printer.CurrentX = 5500
       
        cx = Printer.CurrentX
       
        Printer.CurrentX = cx
        Printer.CurrentY = Printer.CurrentY + 700
        Printer.Print "TotAmount : " & txtTotAmount.Text
       
        Printer.CurrentX = cx
        Printer.CurrentY = Printer.CurrentY + 400
        Printer.Print "SRD : " & txtSRD.Text
       
        Printer.CurrentX = cx
        Printer.CurrentY = Printer.CurrentY + 400
        Printer.Print "Amount to Pay : " & txtTMtPay.Text
       
        Printer.CurrentX = cx
        Printer.CurrentX = 700
        Printer.CurrentY = 10000
        Printer.Print "Page No : " & Printer.Page
        Printer.EndDoc
               
   
End Sub
0
 

Author Comment

by:vlg
ID: 6937363
It worked, although M$ should be ashamed of themselves if that's the best solution they can provide - but thanks for the prompt, relevant response - very much appreciated.

v
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
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
Course of the Month14 days, 16 hours left to enroll

771 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