Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Text in ROWS desn't visible =(
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Text in ROWS desn't visible =(

 Post Reply Post Reply
Author
Message
nmihail View Drop Down
Newbie
Newbie
Avatar

Joined: 02 March 2008
Location: Russian Federation
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote nmihail Quote  Post ReplyReply Direct Link To This Post Topic: Text in ROWS desn't visible =(
    Posted: 02 March 2008 at 7:30pm

uploads/20080307_095846_concrete_WITHOU.zipuploads/20080307_054103_concrete.zipPlease

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
--------------------
Back to Top
Bernie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 July 2007
Location: Taiwan
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bernie Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Posted: 06 March 2008 at 11:12am
Try this:

Record.AddItem (CStr(adoRS.Fields.Item("contact").Value))
Back to Top
nmihail View Drop Down
Newbie
Newbie
Avatar

Joined: 02 March 2008
Location: Russian Federation
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote nmihail Quote  Post ReplyReply Direct Link To This Post Posted: 06 March 2008 at 2:34pm
Very strange, but data invisible  yet
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Posted: 06 March 2008 at 3:59pm
Oops.  Small alteration.  Don't forget to make them Record.AddItem(CStr(...
Back to Top
nmihail View Drop Down
Newbie
Newbie
Avatar

Joined: 02 March 2008
Location: Russian Federation
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote nmihail Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
nmihail View Drop Down
Newbie
Newbie
Avatar

Joined: 02 March 2008
Location: Russian Federation
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote nmihail Quote  Post ReplyReply Direct Link To This Post Posted: 07 March 2008 at 9:59am
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
nmihail View Drop Down
Newbie
Newbie
Avatar

Joined: 02 March 2008
Location: Russian Federation
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote nmihail Quote  Post ReplyReply Direct Link To This Post Posted: 07 March 2008 at 1:23pm
Thank you. Now it works.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.218 seconds.