Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to export data to pivot table office 2007 ?

Status
Not open for further replies.

cesan01

MIS
Jun 21, 2009
9
I have source to export data to pivot table office 2000, 2003.
but it's not working for office 2007.

have any idea or example source to export data to pivot table 2007

S := 'Select * from Employee';
Try
OlePv.CreateObject('OWC.PivotTable.9',False);
Except
Try
OlePv.CreateObject('OWC10.PivotTable.10',False);
Except
Try
OlePv.CreateObject('OWC11.PivotTable.11',False);
Except
end;
end;
end;
OLE := OlePv.OleObject;
OlePv.AutoActivate := aaManual;
Db := 'databasename';
Srv := 'ServerName';
Usr := 'UsrPvt';
Pass := '123';
OLE.ConnectionString := 'PROVIDER=SQLOLEDB.1;'+'Persist Security Info=True;'+
'USER ID='+Usr+'; PASSWORD='+Pass+';'+
'Initial Catalog='+Db+';'+'DATA SOURCE='+Srv+';'+'Connect
Timeout=15';
OLE.CommandText := S;
View := OLE.ActiveView;
View.FilterAxis.InsertFieldSet(View.FieldSets['fieldname1']);
View.RowAxis.InsertFieldSet(View.FieldSets['fieldname2']);
View.ColumnAxis.InsertFieldSet(View.FieldSets['fieldname3']);

OlePv.DoVerb(ovShow);
OLE.Export('',1);


thanks
 
Thanks for reply.

I still use my source because source data use sql command to database.

any suggestions ?
so my source can be working in office 2007 ?

thanks.
 
Thanks for reply.

I still use my source because source data use sql command to database.

any suggestions ?
so my source can be working in office 2007 ?

thanks
 
Use Excel 2007 to record a macro. The convert the VBA to Delphi.
 
thanks for reply,

any suggestion, so my source code can be working office 2007,
What's wrong with my code.


thank's
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top