Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Datasource and DataBinding
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Datasource and DataBinding

 Post Reply Post Reply
Author
Message
Phoenix999 View Drop Down
Newbie
Newbie


Joined: 26 June 2009
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Phoenix999 Quote  Post ReplyReply Direct Link To This Post Topic: Datasource and DataBinding
    Posted: 26 June 2009 at 8:07pm
New user of Codejock (v13).
 
I am having trouble understanding whether the datasource property once set from an ADO data sourse should display the data or not.
 
The header columns get the correct labels but no data is showm
 
I have looked through the forums and note there are a few questions of this type BUT no answer forthcoming. Is this supported?
 
I have other controls that once the datasource is set that is all that is reqiored to display the data.
 
So does Codejock work this way? Or do you have to request row by row from the datasource and manually display the date. Is dso seems to defeat the purpose
 
Back to Top
Lodep59 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 03 April 2008
Status: Offline
Points: 203
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lodep59 Quote  Post ReplyReply Direct Link To This Post Posted: 01 July 2009 at 3:41am
Hi,
 
Have you seen the sample released by CJ ?
You can find it on your installation folder in :
 
  • Samples\ReportControl\VB\ReportDataBinding

In my opinion, this example should be included in the start menu shortcuts ...

Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)
Back to Top
Phoenix999 View Drop Down
Newbie
Newbie


Joined: 26 June 2009
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Phoenix999 Quote  Post ReplyReply Direct Link To This Post Posted: 01 July 2009 at 5:58pm
Maybe I am missing something here.

I have another control where once a datasource is attached it needs no other code to
populate header and columns with correct alignment etc based on the data type.

The ReportControls DataSource I just don't get.

Once attached you still need to iterate to create columns
Seems to defeat the purpose of the DataSouce.

Am I missing the way this is used? There is no automatic poulation correect?
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP and Vista (32bit) - SP 2
Language: Visual DataFlex 15
Back to Top
Lodep59 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 03 April 2008
Status: Offline
Points: 203
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lodep59 Quote  Post ReplyReply Direct Link To This Post Posted: 03 July 2009 at 12:57pm
Originally posted by Phoenix999 Phoenix999 wrote:


The ReportControls DataSource I just don't get.

Once attached you still need to iterate to create columns
Seems to defeat the purpose of the DataSouce.

Am I missing the way this is used? There is no automatic poulation correect?
 
Did you see the sample ?
Example :
 
    ' Open Recordset
    Rs.CursorLocation = adUseClient
    Rs.Open "select * from " & "[" & Table & "]", Con
 
    ' Data binding
    Set wndRecords.DataManager.DataSource = Rs
    wndRecords.DataManager.DataBind
 
 
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)
Back to Top
Phoenix999 View Drop Down
Newbie
Newbie


Joined: 26 June 2009
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Phoenix999 Quote  Post ReplyReply Direct Link To This Post Posted: 03 July 2009 at 8:43pm
Yes I saw the sample and And that is exactly what I am doing.

However all I get is the header row with the column names-there is no data being shown.

Someone else has asked the same question on this forum and got no answer.

So are you saying that the data should be shown automatically?

If so then it isnt happening for me- hence the original question.


Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP and Vista (32bit) - SP 2
Language: Visual DataFlex 15
Back to Top
Lodep59 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 03 April 2008
Status: Offline
Points: 203
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lodep59 Quote  Post ReplyReply Direct Link To This Post Posted: 06 July 2009 at 9:52am
Originally posted by Phoenix999 Phoenix999 wrote:


So are you saying that the data should be shown automatically?
 
Absolutly ! It's the meaning of databinding :)
If you run the sample app made by codejock (without changing something), did you have only the columns headers ?
If yes, can you make a sample with some data that isn't working for you ?
 
 
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)
Back to Top
Phoenix999 View Drop Down
Newbie
Newbie


Joined: 26 June 2009
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Phoenix999 Quote  Post ReplyReply Direct Link To This Post Posted: 09 July 2009 at 4:12am
Ok Firstly I am using Visual DataFlex as my info shows so a sample would be a waste of time.
Now sorry to labour on this but I am trying to get this working as I expect it should.

Now the code in the sample is:

Private Sub ShowRecords(Table as String)
    ' show records
    If not Rs.State = adStateClosed Then Rs.Close
'    Rs.CursorType = adOpenStatic
    Rs.CursorLocation = adUseClient
    Rs.Open "select * from " & "[" & Table & "]", Con
    Set wndRecords.DataManager.DataSource = Rs
    wndRecords.DataManager.DataBind                                 <----- databind here what is the rest of this code doing?
    ' add empty header row
    wndRecords.PaintManager.HeaderRowsDividerStyle = xtpReportFixedRowsDividerOutlook
    wndRecords.HeaderRecords.DeleteAll
    wndRecords.PopulateHeaderRows
    Dim Record as ReportRecord
    Set Record = wndRecords.DataManager.CreateEmptyRecord
    If Record is Nothing Then Exit Sub
    Dim HeaderRecord as ReportRecord
    Set HeaderRecord = wndRecords.HeaderRecords.Add
    Dim i as Integer
    For i = 0 to Record.ItemCount - 1
        HeaderRecord.AddItem Record.item(i).Value
    Next
    wndRecords.ShowHeaderRows = True
    wndRecords.HeaderRowsAllowEdit = True
    wndRecords.PopulateHeaderRows
    Set Record = Nothing


This appears to me that there is more than just setting the Datasource property to allow the data to display. Is this correct?

Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP and Vista (32bit) - SP 2
Language: Visual DataFlex 15
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 10 July 2009 at 1:38pm
If you are using a VB6 datasource class as your datasource, the CJ RC doesn't support it.
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Phoenix999 View Drop Down
Newbie
Newbie


Joined: 26 June 2009
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Phoenix999 Quote  Post ReplyReply Direct Link To This Post Posted: 10 July 2009 at 7:50pm
I am using ADO
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP and Vista (32bit) - SP 2
Language: Visual DataFlex 15
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2009 at 8:13am
For ADO should be fine (at least in known environments - may be Dataflex have some restrictions?)
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.173 seconds.