'Print' is not a member of 'System.Windows.Forms.Panel'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prigupta2
    New Member
    • Oct 2008
    • 33

    'Print' is not a member of 'System.Windows.Forms.Panel'

    Rep_pic(num).Pr int(LSTR & VB6.Format(Desc ription, "00") & Crlf & "BOTTOM", TAB(38), VB6.Format(Coun t, "00") & " " & VB6.Format(MLEN , "0.00") & " " & VB6.Format(MWID , "0.00"), TAB(71), VB6.Format(QTY9 , "0.00"))



    Error 10 'Print' is not a member of 'System.Windows .Forms.Panel'.
    print is not use in vbdotne
    please help
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    What are you trying to do with that Print then? As you can see there is no Print method in the Panel class.

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      Throw a Label control on their and append text to it?
      Or use the Graphics object to DrawString() onthe control itself

      Comment

      • prigupta2
        New Member
        • Oct 2008
        • 33

        #4
        Originally posted by r035198x
        What are you trying to do with that Print then? As you can see there is no Print method in the Panel class.
        sir
        i want to print report in txt formet

        Comment

        • r035198x
          MVP
          • Sep 2006
          • 13225

          #5
          Originally posted by prigupta2
          sir
          i want to print report in txt formet
          Do you want to send a report to a printer or do you want to display some text on a Panel?

          Comment

          • prigupta2
            New Member
            • Oct 2008
            • 33

            #6
            Originally posted by r035198x
            Do you want to send a report to a printer or do you want to display some text on a Panel?
            sir
            actully i want to convert vb6.0 project in vbdotnet.
            vb6.0 code as follows:======= =
            Code:
            Private Sub manualload()
             
              Dim Data As Single
               Dim QTY As Double
               Dim QTY1 As Double
               Dim QTY2 As Double
               Dim Totalquantity As Single
               Dim criteria As String
               Dim ColumnTotal As Double
               Dim Cum As String
               Dim Count As Single
               Dim ds As Recordset
               
            Dim LLL As Single
            Dim Strlength As Single
            Dim StrBreadth As Single
            Dim STRDEPTH As Single
            Dim LENSTR As Single
            LLL = 32
            STRCOUNT = 6
            Strlength = 6
            StrBreadth = 6
            STRDEPTH = 5
             
              
               FFN = FreeFile
               Open repnam For Output As #FFN
              
               Header
               criteria = "Select * from WSSDefin order by Description  asc"
               Set ds = CurDb.OpenRecordset(criteria, dbOpenDynaset)
               
               Rep_Col1 = ""
               REP_COL2 = ""
              
               ''MSGBOX repnam
               While Not ds.EOF
                    
                    
                  If cpsharma Then
                    cpsharma = False
                    Dstair.MoveLast
                    cpS = ds.RecordCount
                    ds.MoveFirst
                    Pre = Format(50 / cpS, "0.00")
               End If
                percent = percent + Pre
                If percent >= 100 Then
                    percent = 100
                End If
                Main_frm.STATUS_BAR.Panels(1) = "Processing Complete " & Format(percent, "0.00") & "%"
            
                      No = ds(1)
                     length = ds(2)
                     Breadth = ds(3)
                     Depth = ds(4)
                     
                     Count = ds(1)
                     
                     
                   If (ds(3) <> 0) And (ds(4) <> 0) Then           'No * Length * Breadth *Depth
                    Cum = "CuM"
                    QTY = ds(1) * ds(2) * ds(3) * ds(4)
                     Totalquantity = Totalquantity + QTY
                     ColumnTotal = ColumnTotal + Count
                     Rep_pic(num).Print ds(0); Tab(38); Format(ds(1), "00"); Tab(44); Format(ds(2), "0.00"); Tab(53); Format(ds(3), "0.00"); Tab(63); Format(ds(4), "0.00"); Tab(70); Format(QTY, "0.00")
                     REP_COL2 = REP_COL2 + ds(0) + Space(LLL - Str$(Len(ds(0)))) + Format(ds(1), "00") + Space(STRCOUNT - Str$(Len(ds(1)))) + Format(ds(2), "0.00") + Space(Strlength - Str$(Len(ds(2)))) + Format(ds(3), "0.00") + Space(StrBreadth - Str$(Len(ds(3)))) + Format(ds(4), "0.00") + Space(STRDEPTH - Str$(Len(ds(4)))) + Format(QTY, "00.00") + Crlf
                    
                     End If
                           
                    If (ds(3) = 0) Then        'No * Length * Depth
                     Cum = "SqM"
                     QTY = ds(1) * ds(2) * ds(4)
                     Totalquantity = Totalquantity + QTY
                     ColumnTotal = ColumnTotal + Count
                     Rep_pic(num).Print ds(0); Tab(38); Format(ds(1), "00"); Tab(44); Format(ds(2), "0.00"); Tab(63); Format(ds(4), "0.00"); Tab(70); Format(QTY, "0.00")
                     REP_COL2 = REP_COL2 + ds(0) + Space(LLL - Str$(Len(ds(0)))) + Format(ds(1), "00") + Space(STRCOUNT - Str$(Len(ds(1)))) + Format(ds(2), "0.00") + Space(Strlength - Str$(Len(ds(2)))) + Space(StrBreadth + 3) + Format(ds(4), "0.00") + Space(STRDEPTH - Str$(Len(ds(4)))) + Format(QTY, "00.00") + Crlf
                    
                    End If
                    
                     If (ds(4) = 0) And (ds(2) <> 0) And (ds(3) <> 0) Then 'No * Length * Breadth
                     Cum = "SqM"
                     QTY = ds(1) * ds(2) * ds(3)
                     Totalquantity = Totalquantity + QTY
                     ColumnTotal = ColumnTotal + Count
                     Rep_pic(num).Print ds(0); Tab(38); Format(ds(1), "00"); Tab(44); Format(ds(2), "0.00"); Tab(53); Format(ds(3), "0.00"); Tab(70); Format(QTY, "0.00")
                     REP_COL2 = REP_COL2 + ds(0) + Space(LLL - Str$(Len(ds(0)))) + Format(ds(1), "00") + Space(STRCOUNT - Str$(Len(ds(1)))) + Format(ds(2), "0.00") + Space(Strlength - Str$(Len(ds(2)))) + Format(ds(3), "0.00") + Space(StrBreadth - Str$(Len(ds(3)))) + Space(STRDEPTH + 3) + Format(QTY, "00.00") + Crlf
                     
                    End If
                          
                    Rep_pic(num).Print
                    REP_COL2 = REP_COL2 + Crlf
                    Lcount = Lcount + 1
                    Checkpagelimit
                    QTY = 0
                    length = 0
                    Breadth = 0
                    Depth = 0
                  
                    ds.MoveNext
               Wend
               Checkpagelimit
               ReportFooter ColumnTotal, Totalquantity, Cum
               Page.Caption = "Page: " & 1 & " of " & num + 1
               Print #FFN, REP_COL2 '+ Chr(12)
               Close #FFN
            ds.Close
            End Sub

            please help to convert in vbdotnet
            Last edited by Curtis Rutland; Oct 23 '08, 01:18 PM. Reason: Added Code Tags - Please surround your code with [CODE] and [/CODE]

            Comment

            • Plater
              Recognized Expert Expert
              • Apr 2007
              • 7872

              #7
              What type of object is Rep_pic?
              And more specifically, you are using it as an array? (Rep_pic(num)), so what type of object is returned by Rep_pic(num) ?
              Based on the error message it looks like its a Panel. So you have an array of Panels?

              .Print() in vb6 I *thought* was used to just print text directly onto the form/control. That was a silly process, just use a label.

              I will never understand how I once thought VB was a good language.

              Comment

              Working...