Export excel file with header
Export excel file with header
Hi,
I would like to export a chart as a xls file with headers like "xTime","yPosition" instead of X and Y only. I searched the functions and found only
m_chart1.Series(0).GetYValue.GetName()
no function like
m_chart1.Series(0).GetYValue.SetName().
How can I use headers other than the default X and Y when exporting xls file?
Thank you.
David
I would like to export a chart as a xls file with headers like "xTime","yPosition" instead of X and Y only. I searched the functions and found only
m_chart1.Series(0).GetYValue.GetName()
no function like
m_chart1.Series(0).GetYValue.SetName().
How can I use headers other than the default X and Y when exporting xls file?
Thank you.
David
Hi David,
which TeeChart Version are you using ?
Using the latest v7.07 you should be able to set the Header for X and YValues using the following code (vb code) :
which TeeChart Version are you using ?
Using the latest v7.07 you should be able to set the Header for X and YValues using the following code (vb code) :
Code: Select all
With TChart1
.Series(0).FillSampleValues (10)
.Export.asXLS.IncludeHeader = True
.Series(0).YValues.Name = "YVals"
.Export.asXLS.SaveToFile "c:\a.xls"
End With
Pep Jorge
http://support.steema.com
http://support.steema.com
Hi David,
about the Name, it will not be displayed nowhere. It's just to be able to assign a custom name to identificate.
From the Help :
You may change the name of a Series with this property. Use is optional, It is not necessary to name Series for them to function correctly. Use the Series.Title property to give Series titles to display in Legends and the Chart Editor.
about the Name, it will not be displayed nowhere. It's just to be able to assign a custom name to identificate.
From the Help :
You may change the name of a Series with this property. Use is optional, It is not necessary to name Series for them to function correctly. Use the Series.Title property to give Series titles to display in Legends and the Chart Editor.
Pep Jorge
http://support.steema.com
http://support.steema.com
Hi, Pep,Pep wrote:Code: Select all
With TChart1 .Series(0).FillSampleValues (10) .Export.asXLS.IncludeHeader = True .Series(0).YValues.Name = "YVals" .Export.asXLS.SaveToFile "c:\a.xls" End With
I am using the latest v7.07 version. Would you please transfer this segment of code into VC++ code? I couldn't find a suitable function in VC++ for "Series(0).YValues.Name = "YVals"".
Thank you very much!
David
Hi David,
yes, of course :
yes, of course :
Code: Select all
m_chart.AddSeries(0);
m_chart.Series(0).FillSampleValues(10);
m_chart.GetExport().GetAsXLS().SetIncludeHeader(true);
m_chart.Series(0).GetYValues().SetName("MyYHeader");
m_chart.GetExport().GetAsXLS().SaveToFile("myfile.xls");
Pep Jorge
http://support.steema.com
http://support.steema.com
Hi, Pep,
How come I couldn't find the function SetName() and the auto-completion in VC++.NET doesn't have this function listed either. After I manually typed it and compiled it, there is an error saying
error C2039: 'SetName' : is not a member of 'CValueList'
Any suggestions? (I am using the lastest version)
David
How come I couldn't find the function SetName() and the auto-completion in VC++.NET doesn't have this function listed either. After I manually typed it and compiled it, there is an error saying
error C2039: 'SetName' : is not a member of 'CValueList'
Any suggestions? (I am using the lastest version)
David
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi David,
It works fine for me here using v7.0.0.7 and including CValueList class in the project ClassView. Can you please check that?
Also notice that we have just posted 7.0.0.8 at our Customer Download Area.
It works fine for me here using v7.0.0.7 and including CValueList class in the project ClassView. Can you please check that?
Also notice that we have just posted 7.0.0.8 at our Customer Download Area.
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, Pep,
It is so strange. I read the source code of valuelist.h and valuelist.cpp and there is no function named SetName(). Am I right to use the files under the folder \TeeChart Pro v7 ActiveX Control\Utilities\New VC Classes? Even after I installed the latest 7.0.0.8, I still can't found the function SetName(). I also tried the example projects for VC6, SetName() didn't work either.
So any idea what's wrong here?
David
PS: I included the CValuelist class in the valuelist.h
class CValueList : public COleDispatchDriver
{
public:
CValueList() {} // Calls COleDispatchDriver default constructor
CValueList(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
CValueList(const CValueList& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
public:
// Operations
public:
long GetCount();
BOOL GetDateTime();
void SetDateTime(BOOL bNewValue);
double GetFirst();
double GetLast();
double GetMaximum();
double GetMinimum();
long GetOrder();
void SetOrder(long nNewValue);
double GetTotal();
double GetTotalABS();
double GetValue(long Index);
void SetValue(long Index, double newValue);
CString GetValueSource();
void SetValueSource(LPCTSTR lpszNewValue);
void Delete(long Index);
void FillSequence();
long Locate(double SomeValue);
void Sort();
BOOL GetModified();
void SetModified(BOOL bNewValue);
double GetTempValue();
void SetTempValue(double newValue);
CString GetName();
};
It is so strange. I read the source code of valuelist.h and valuelist.cpp and there is no function named SetName(). Am I right to use the files under the folder \TeeChart Pro v7 ActiveX Control\Utilities\New VC Classes? Even after I installed the latest 7.0.0.8, I still can't found the function SetName(). I also tried the example projects for VC6, SetName() didn't work either.
So any idea what's wrong here?
David
PS: I included the CValuelist class in the valuelist.h
class CValueList : public COleDispatchDriver
{
public:
CValueList() {} // Calls COleDispatchDriver default constructor
CValueList(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
CValueList(const CValueList& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
public:
// Operations
public:
long GetCount();
BOOL GetDateTime();
void SetDateTime(BOOL bNewValue);
double GetFirst();
double GetLast();
double GetMaximum();
double GetMinimum();
long GetOrder();
void SetOrder(long nNewValue);
double GetTotal();
double GetTotalABS();
double GetValue(long Index);
void SetValue(long Index, double newValue);
CString GetValueSource();
void SetValueSource(LPCTSTR lpszNewValue);
void Delete(long Index);
void FillSequence();
long Locate(double SomeValue);
void Sort();
BOOL GetModified();
void SetModified(BOOL bNewValue);
double GetTempValue();
void SetTempValue(double newValue);
CString GetName();
};
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi David,
It works fine for me here having the CValueList class in the ClassView tab in Visual C++. If you wnat I'll send you the project I'm using.
It works fine for me here having the CValueList class in the ClassView tab in Visual C++. If you wnat I'll send you the project I'm using.
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi David,
Ok, I've just sent a project using SetName to your forums contact e-mail address.
Ok, I've just sent a project using SetName to your forums contact e-mail address.
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, Narcís,
I got the project file and I checked the valuelist.h file you included. The reason why it works fine in your project is because there is a function void SetName(LPCTSTR lpszNewValue); in your valuelist.h file. How come we have different files? Even the files in the lastes 7.0.0.8 doesn't have this function. Would you please check if the files released are the correct ones? I think it could be a serious issue if the released files are not the correct ones. As I attached in my last post, the content of my valuelist.h is different from yours at the last line. Below is the comparision.
The content of my valuelist.h (the last few lines only)
.....
void Sort();
BOOL GetModified();
void SetModified(BOOL bNewValue);
double GetTempValue();
void SetTempValue(double newValue);
CString GetName();
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
The content of the valuelist.h in the zipped file you emailed:
.........
void Sort();
BOOL GetModified();
void SetModified(BOOL bNewValue);
double GetTempValue();
void SetTempValue(double newValue);
CString GetName();
void SetName(LPCTSTR lpszNewValue); //Here is the difference
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
Would you please check why there is a difference?
Thank you very much!
David
I got the project file and I checked the valuelist.h file you included. The reason why it works fine in your project is because there is a function void SetName(LPCTSTR lpszNewValue); in your valuelist.h file. How come we have different files? Even the files in the lastes 7.0.0.8 doesn't have this function. Would you please check if the files released are the correct ones? I think it could be a serious issue if the released files are not the correct ones. As I attached in my last post, the content of my valuelist.h is different from yours at the last line. Below is the comparision.
The content of my valuelist.h (the last few lines only)
.....
void Sort();
BOOL GetModified();
void SetModified(BOOL bNewValue);
double GetTempValue();
void SetTempValue(double newValue);
CString GetName();
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
The content of the valuelist.h in the zipped file you emailed:
.........
void Sort();
BOOL GetModified();
void SetModified(BOOL bNewValue);
double GetTempValue();
void SetTempValue(double newValue);
CString GetName();
void SetName(LPCTSTR lpszNewValue); //Here is the difference

};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
Would you please check why there is a difference?
Thank you very much!
David
Hi, Narcís,
I also noticed that several other files are also different in size between those in your project and those in the folder \TeeChart Pro v7 ActiveX Control\Utilities\New VC Classes\, such as areaseries.h and cpp, annotationtool.h and cpp, etc. In your files there are some new functions. May I know why there is the difference?
Thank you very much!
David
I also noticed that several other files are also different in size between those in your project and those in the folder \TeeChart Pro v7 ActiveX Control\Utilities\New VC Classes\, such as areaseries.h and cpp, annotationtool.h and cpp, etc. In your files there are some new functions. May I know why there is the difference?
Thank you very much!
David