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
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