Print Page | Close Window

Text in ROWS desn't visible =(

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=9765
Printed Date: 14 November 2024 at 12:04am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Text in ROWS desn't visible =(
Posted By: nmihail
Subject: Text in ROWS desn't visible =(
Date Posted: 02 March 2008 at 7:30pm

https://forum.codejock.com/uploads/20080307_095846_concrete_WITHOU.zip - uploads/20080307_095846_concrete_WITHOU.zip https://forum.codejock.com/uploads/20080307_054103_concrete.zip - uploads/20080307_054103_concrete.zip Please

Help Me. Rows added, but data invisible (empty rows). Another control (textbox, list) shows text correctly. I use a few repotrcontrols, one shows data, but others don't. I show a part of code. The same code used by all reportcontrols. How could data be visible?
-------------------
        Public adoRS As New ADODB.Recordset
        Public adoCN As New ADODB.Connection
        Public sSource As String
        Public sConn As String
        Public strSql As String
        Public Record As ReportRecord
        Public pItem As ReportRecordItem
Private Sub Fill ()
    strSql = "SELECT * FROM tab_carcompaniescontacts WHERE idcarcompany=1;"
    adoCN.Open sConn
    adoRS.Open strSql, adoCN, adOpenKeyset, adLockOptimistic
   
    Do While Not adoRS.EOF
        With ReportCarCompanyContacts
            Set Record = ReportCarCompanyContacts.Records.Add
            Set pItem = Record.AddItem(adoRS.Fields.Item("id").Value)
            Record.AddItem (adoRS.Fields.Item("contact").Value)
            Record.AddItem (adoRS.Fields.Item("tel").Value)
        End With
        'Get the next record.
            adoRS.MoveNext
    Loop
        ReportCarCompanyContacts.Populate
        adoRS.Close
        adoCN.Close
End Sub
--------------------



Replies:
Posted By: Bernie
Date Posted: 05 March 2008 at 6:18am
DIm Tmp
Tmp = adoRS.Fields.Item("contact").Value
Record.AddItem Tmp
 
 
I don't know why
but these codes can work!!!
 


-------------
Bernie Ho, Planning Manager + IELTS specialist + part-time programmer
Taiwan, R.O.C


Posted By: jcollier
Date Posted: 06 March 2008 at 11:12am
Try this:

Record.AddItem (CStr(adoRS.Fields.Item("contact").Value))


Posted By: nmihail
Date Posted: 06 March 2008 at 2:34pm
Very strange, but data invisible  yet


Posted By: jcollier
Date Posted: 06 March 2008 at 3:58pm
Hm.  Try this:

Do While Not adoRS.EOF
        With ReportCarCompanyContacts
            Set Record = ReportCarCompanyContacts.Records.Add
            Set pItem = Record.AddItem(adoRS!ID)
            set pItem = Record.AddItem (adoRS!contact)
            set pItem = Record.AddItem (adoRS!tel)
        End With
        'Get the next record.
            adoRS.MoveNext
    Loop
        ReportCarCompanyContacts.Populate


Posted By: jcollier
Date Posted: 06 March 2008 at 3:59pm
Oops.  Small alteration.  Don't forget to make them Record.AddItem(CStr(...


Posted By: nmihail
Date Posted: 07 March 2008 at 5:45am
The same situation. Not visible.
I have uploaded source. May be i made mistake. Please see it.
the source is original without modified code according this forum/ but i tried it. 
the table in frmNewCarcompany.frm must show info from mdb.
table in frmCarcompanies.frm shows correctly.
https://forum.codejock.com/uploads/20080307_054103_concrete.zip - https://forum.codejock.com/uploads/20080307_054103_concrete.zip


Posted By: jcollier
Date Posted: 07 March 2008 at 9:25am
I can't load the project.  I don't have DBGrid.  Can you send one without that grid?


Posted By: nmihail
Date Posted: 07 March 2008 at 9:59am
https://forum.codejock.com/uploads/20080307_095846_concrete_WITHOU.zip - https://forum.codejock.com/uploads/20080307_095846_concrete_WITHOU.zip
Project without DBGrid


Posted By: jcollier
Date Posted: 07 March 2008 at 10:13am
Got it!  You should be able to figure out the other places changes need to be made based on the following changes:

Public Const CARCOMPANY_PERSON_NUMBER = 0
Public Const CARCOMPANY_PERSON_NAME = 1
Public Const CARCOMPANY_PERSON_PHONE = 2


Public Sub SelectedCarcompanyShowContacts(index As Integer)
   
    sSource = AddBackslash(App.Path) & "\db.mdb"
    sConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sSource & ";Persist Security Info=False;Jet OLEDB:database Password="
    '----------------------------------------
    strSql = "SELECT * FROM tab_carcompaniescontacts WHERE idcarcompany=" & index & ";"
    adoCN.Open sConn
    adoRS.Open strSql, adoCN, adOpenKeyset, adLockOptimistic
   
    With frmNewCarcompany.ReportCarCompanyContacts
        .Records.DeleteAll
   
        Do While Not adoRS.EOF
           
                Set Record = .Records.Add()
                Set pItem = Record.AddItem(CStr(adoRS!Id))
                Set pItem = Record.AddItem(CStr(adoRS!contact))
                Set pItem = Record.AddItem(CStr(adoRS!Tel))
           
            'Get the next record.
                adoRS.MoveNext
        Loop
        .Populate
    End With
   
    adoRS.Close
    adoCN.Close
End Sub


Posted By: nmihail
Date Posted: 07 March 2008 at 1:23pm
Thank you. Now it works.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net