Bound/Unbound Data Report?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pqsoftware
    New Member
    • Dec 2007
    • 7

    Bound/Unbound Data Report?

    I have a small VB6 program that uses Random Access Files. The data is stored in type decs. Can I bind this data to the Data Report or duplicate the data into a recordset and then use this in the data report? Thanks.
  • 9815402440
    New Member
    • Oct 2007
    • 180

    #2
    hi

    you can show unbound datareport. use following logic.

    dim rstRpt as new adodb.recordset
    with rstrpt
    .fields.append "fld1",adbs tr
    .open
    .addnew
    .fields(0).valu e = "any value"
    end with

    with datareport1
    .datamemeber = ""
    set .datasource = rstrpt
    ''Draw lables in datareport (in details section) and set their canGrow property to true.
    ''dont use textboxes in this case.
    ' i name details section as Det
    dim i as integer
    for i = 0 to 20
    .sections("det" ).controls("lab le1").caption = i & chr(13)
    next
    .refresh
    .show
    end with

    use can design the report using lables only.

    but the best way out is to make recordset at run time and fill it with the values you want
    then bind the datareport as follows.

    dim rstRpt as new adodb.recordset
    with rstrpt
    .fields.append "fld1",addo uble
    .open
    dim l as long
    for l = 0 to 20
    .addnew
    .fields(0).valu e = l
    next
    end with

    with datareport1
    .datamemeber = ""
    set .datasource = rstrpt
    .sections("det" ).controls("Tex t1").datamemb er = ""
    .sections("det" ).controls("Tex t1").datafiel d = "fld1"
    .refresh
    .show
    end with


    hope this will help you

    regards
    manpreet singh dhillon hoshiarpur

    Comment

    • pqsoftware
      New Member
      • Dec 2007
      • 7

      #3
      Thanks Manpreet, just what I needed.

      Comment

      Working...