Hello,
I would like to pass a recordset to crosstab source object.
Something like:
set rs = new adodb.recordset
rs.fields.append("grp", ...)
rs.fields.append("lbl", ...)
rs.fields.append("val", ...)
for i = 0 to ...
rs.addnew
rs(0).value = g(i): rs(1).value = l(i): rs(2).value = v(i)
next i
rs.batchupdate
'crosstabsource.datasource = rs
is it possible?
Yours
Carlos
Can I pass a disconnected recordset to a crosstab source
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hola Carlos,
Yes, this is possible. For more information on how to use TeeChart with databases please read "Tutorial 8 - ADO Database access" and have a look at the features demo examples (All Features\Welcome!\Database Charts). You'll find the tutorials and features demo at the TeeChart program group.
Yes, this is possible. For more information on how to use TeeChart with databases please read "Tutorial 8 - ADO Database access" and have a look at the features demo examples (All Features\Welcome!\Database Charts). You'll find the tutorials and features demo at the TeeChart program group.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi Carlos,
you cannot pass a recordset directly to the CrosstabSource, that I know of. It can be only used as in the DB CrossTab source example, using similar code to the following :
But, you can always generate the recordset, iterate through it and then add data manually to the Chart Series using the AddXY method.
you cannot pass a recordset directly to the CrosstabSource, that I know of. It can be only used as in the DB CrossTab source example, using similar code to the following :
Code: Select all
Private Sub Form_Load()
With CrossTabSource1
.DataSet = "DSN=TeeChart Pro Database; SQL=select * from orders"
.Series = TChart1.Series(0)
.GroupField = "Terms"
.LabelField = "PaymType"
.ValueField = "AmntPaid"
End With
End Sub
Pep Jorge
http://support.steema.com
http://support.steema.com