I seem unable to get the DataSource decoded from a VARIANT
VARIANT DataSrc = m_Chart.Series(0).GetDataSource();
// Ok now what
I'd like to get the connection string out and what the axis value string are set to.
Thanks
Getting the DataSource Info out of chart
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Getting the DataSource Info out of chart
Hi jfrancis,
What are you exactly trying to achieve with that? If you want to get axes labels you'd better use OnGetAxisLabel or OnGetNextAxisLabel event. For more information about that please read tutorial 4.
Hope this helps!
What are you exactly trying to achieve with that? If you want to get axes labels you'd better use OnGetAxisLabel or OnGetNextAxisLabel event. For more information about that please read tutorial 4.
Hope this helps!
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 |
Re: Getting the DataSource Info out of chart
Sorry was was not clear.
I'm not interested in the Axis-Label, that is ok at my end.
What I'm after is to look at the contents of the DataSource, it is returned as a VARIANT data type, see "VARIANT DataSrc = m_Chart.Series(0).GetDataSource();"
I am unsuccessful in converting it into an ADO (ADODB::_ConnectionPtr) object so that I can read the "connection string" and
the ADO (ADODB::_RecordsetPtr) to get the "source" or SQL command string.
I am working in C++ and MFC if this helps.
Thanks,
John Francis
I'm not interested in the Axis-Label, that is ok at my end.
What I'm after is to look at the contents of the DataSource, it is returned as a VARIANT data type, see "VARIANT DataSrc = m_Chart.Series(0).GetDataSource();"
I am unsuccessful in converting it into an ADO (ADODB::_ConnectionPtr) object so that I can read the "connection string" and
the ADO (ADODB::_RecordsetPtr) to get the "source" or SQL command string.
I am working in C++ and MFC if this helps.
Thanks,
John Francis
Re: Getting the DataSource Info out of chart
Hi John Francis,
We've investigated it but I'm afraid we don't see a way to retrieve this information with TeeChart AX.
We've investigated it but I'm afraid we don't see a way to retrieve this information with TeeChart AX.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Getting the DataSource Info out of chart
I got some of the info I needed see source code below:
//|----------------------------------------------------------------------------
void CTest_TChart_DB_Load_vADlg::DisplaySourceStr(void)
{
VARIANT vrDataSrc = m_Chart.Series(0).GetDataSource();
ADODB::_RecordsetPtr aRecordSet = (_variant_t)vrDataSrc;
_variant_t var;
var = aRecordSet->GetSource();
CString strSource = (_bstr_t(var.bstrVal));
// Source String
CString sourcestr;
sourcestr.Format("Source: %s", strSource );
m_Source.SetWindowText( sourcestr );
_variant_t varConnect;
varConnect = aRecordSet->GetActiveConnection();
ADODB::_ConnectionPtr aConnection = (_variant_t)varConnect;
CString strConn = aConnection->GetConnectionString();
CString connstr;
connstr.Format("Connection String:\n %s", strConn);
int count = connstr.Replace( _T(";"), _T(";\r\n") );
m_ConnEditCtrl.SetWindowText( connstr );
}
//|----------------------------------------------------------------------------
void CTest_TChart_DB_Load_vADlg::DisplaySourceStr(void)
{
VARIANT vrDataSrc = m_Chart.Series(0).GetDataSource();
ADODB::_RecordsetPtr aRecordSet = (_variant_t)vrDataSrc;
_variant_t var;
var = aRecordSet->GetSource();
CString strSource = (_bstr_t(var.bstrVal));
// Source String
CString sourcestr;
sourcestr.Format("Source: %s", strSource );
m_Source.SetWindowText( sourcestr );
_variant_t varConnect;
varConnect = aRecordSet->GetActiveConnection();
ADODB::_ConnectionPtr aConnection = (_variant_t)varConnect;
CString strConn = aConnection->GetConnectionString();
CString connstr;
connstr.Format("Connection String:\n %s", strConn);
int count = connstr.Replace( _T(";"), _T(";\r\n") );
m_ConnEditCtrl.SetWindowText( connstr );
}
Re: Getting the DataSource Info out of chart
Hi jfrancis,
Thank you for your feedback. It may help another user with a similar problem in the future.
Thank you for your feedback. It may help another user with a similar problem in the future.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |