[Qt-interest] ActiveQT + Excel Chart Series

Michele Ciampichetti cia.michele at gmail.com
Fri May 20 17:37:51 CEST 2011


Goodevening to everybody,
I should create an excel chart from my QT 4.6 application.
I'using ActiveQT on Mingw (Win XP SO), and I obtain to write some data to an
excel sheet.

How I can add a Series to the chart now?
This is my code.

*QAxObject * excel = new QAxObject("Excel.Application",0); *

*QAxObject *workbooks = excel->querySubObject( "Workbooks" );*

* *

*QAxObject *workbook = workbooks->querySubObject( "Add");*

* *

*QAxObject *sheets = workbook->querySubObject( "Worksheets" );*

* *

*QAxObject *charts =workbook->querySubObject("Charts");*

* *

*QAxObject *chart = charts->querySubObject("Add");*

* *

*QAxObject* sheet = sheets->querySubObject( "Item( int )", 1 );*

* *

*sheet->setProperty("Name","Dati applicazione");*

* *

*QAxObject*cell=sheet->querySubObject("Cells(int,int)",1,1);*

* *

*cell->dynamicCall("SetValue(String)","Serie");*

* *

*cell=sheet->querySubObject("Cells(int,int)",1,2);*

* *

*cell->dynamicCall("SetValue(String)","Dati");*

* *

*for (int i=2; i<10; i++){*

* *

*cell=sheet->querySubObject("Cells(int,int)",i,1);*

* *

*cell->dynamicCall("SetValue(int)",i-1);*

* *

*cell=sheet->querySubObject("Cells(int,int)",i,2);*

* *

*cell->dynamicCall("SetValue(double)",qrand());*

* *

*}*

* *

*chart->setProperty("Name","Report Grafico dei dati");*

* *

*chart->setProperty("CharThype",73);*

* *

*cell=sheet->querySubObject("Cells(int,int)",10,5);*

* *

*QAxObject *series = chart->property("SeriesCollection");*


I got this error:
QAxBase: Error calling IDispatch member SeriesCollection: Member not found


Thanks for your time

Michele
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110520/70cb2441/attachment.html 


More information about the Qt-interest-old mailing list