Results 1 to 4 of 4

Thread: Changing fields on Datareport

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    15

    Changing fields on Datareport

    I have designed a datareport with VB6. With a query I deside which info I will display on the report.
    There is a field named Primary_address, this field is an integer field.
    His value can be 0,1,2,3.... etc. When the value is 0, I will display
    a text in the report. How can I do that? I used the code below.

    VB Code:
    1. Dim rsDutten As ADODB.Recordset
    2.  
    3.     Set rsDutten = New ADODB.Recordset
    4.     rsDutten.CursorType = adOpenKeyset      
    5.     rsDutten.LockType = adLockOptimistic    
    6.     rsDutten.ActiveConnection = cnParm
    7.  
    8.     rsDutten.Source = "SELECT Type, Benaming, Fabrikant, Datum,
    9.  Revisie_proc, Aktief, Driver, Primary_address, Secondary_address FROM
    10.  dutten WHERE Station = '" & Station & "' ORDER BY Type;"
    11.     rsDutten.Open
    12.  
    13.     Set DataReport2.DataSource = rsDutten
    14.     DataReport2.Orientation = rptOrientLandscape
    15.     DataReport2.Show

  2. #2
    Hyperactive Member binilmb's Avatar
    Join Date
    Nov 2005
    Location
    Kochi
    Posts
    472

    Re: Changing fields on Datareport

    place a label control in the data report. in my code it is label 3 and the section in section5
    if rsDutten("Primary_address").value="0" then
    DataReport2.Sections("Section5").Controls("Label3").Caption = "test"
    end if


    This will work only for displaying a single record. If ur displaying multiple record the value will be the same. i have tried this a lot.
    I think u need to try it in sql to do so.
    if u got the solution pls let me know
    ßįňįl

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Changing fields on Datareport

    Moved to reporting section

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    15

    Re: Changing fields on Datareport

    I will display multiple records in a section. I don't know how I handle my wish in a query. Does somebody know how?

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