Print Page | Close Window

Datasource and DataBinding

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=14635
Printed Date: 05 October 2024 at 3:30am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Datasource and DataBinding
Posted By: Phoenix999
Subject: Datasource and DataBinding
Date 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
 



Replies:
Posted By: Lodep59
Date 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)


Posted By: Phoenix999
Date 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


Posted By: Lodep59
Date 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)


Posted By: Phoenix999
Date 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


Posted By: Lodep59
Date 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)


Posted By: Phoenix999
Date 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


Posted By: jpbro
Date 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



Posted By: Phoenix999
Date 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


Posted By: mdoubson
Date Posted: 24 July 2009 at 8:13am
For ADO should be fine (at least in known environments - may be Dataflex have some restrictions?)

-------------
Mark Doubson, Ph.D.



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