Results 1 to 5 of 5

Thread: Record Number in Data Report (VB6 - SP6)

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2008
    Posts
    10

    Unhappy Record Number in Data Report (VB6 - SP6)

    Hi Gurus,

    I am using data report but I stuck how can I show record number (Serial number column) in my report?

    report without serial number is working fine ?

    my code is : -

    Code:
    Public Function Shd_int_pvtE()
    
    
    shsql = "Select m.reader, m.stat, m.cons, m.mtype, m.cdat,m.cmrd,m.cbtp,m.anam,m.mtrn,S.RDATE, " & _
            "S.MTRD,S.BTYP,S.RMONTH, MTRD - CMRD as consumption " & _
            "from mnbmast M LEFT join sitemr s on M.STAT = S.STAT AND M.CONS = S.CONS " & _
            "where m.reader = " & txtreader.Text & " " & _
            "and left(mtype,1) = 1 "
    
    Set shrs = shcon.Execute(shsql)
    
    Do Until shrs.EOF
    
    shsreader = shrs!READER
    'shdla = shrs!MTYPE
    'shsstat = shrs!STAT
    'shscons = shrs!CONS
    'shmcbtp = shrs!CBTP
    'shmmtrn = shrs!MTRN
    'shmcdat = shrs!CDAT
    'shmcmrd = shrs!CMRD
    'shsrdate = shrs!RDATE
    'shsmtrd = shrs!MTRD
    'shsbtyp = shrs!BTYP
    'shsrmonth = Nz(RMONTH, "0")
    'shanam = shrs!ANAM
    'shsconsumption = CONSUMPTION
        
        shrs.MoveNext
    Loop
    
      Set DataReport4.DataSource = shrs
      
      DataReport4.ReportWidth = 11.5
      DataReport4.TopMargin = 0.25
      DataReport4.LeftMargin = 0.75
      DataReport4.RightMargin = 0.25
      DataReport4.BottomMargin = 0.25
      
     
    DataReport4.Sections("Section4").Controls.Item("rptschhdr").Caption = "Schedule for Electric - Private"
    DataReport4.Sections("Section2").Controls.Item("rptreader").Caption = Format(shsreader, "0000")
    DataReport4.Sections("Section2").Controls.Item("ConsName").Caption = "Consumer Name"
    
    With DataReport4
    
    .Orientation = rptOrientLandscape
    .Show
          
    End With
    
    End Function
    can any one help me how to add S.NO field in my report or can I use rownum in my sql query I have tried but I dont know how to actually use it in VB 6.

    Thanks
    Last edited by si_the_geek; Dec 21st, 2008 at 01:07 PM. Reason: corrected Code tags

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