Grazie x il suggerimento, ho provato ma ottengo questo errore:

Errore di run-time di Microsoft VBScript (0x800A01B6)
Proprietà o metodo non supportati dall'oggetto: 'htmlData'
/prova1.asp, line 42

L'oggetto che definisco è una pivottable e il componente è quello di OfficeXP. Sicuramente ho messo qualcosa di troppo o manca qualcosa .... ma cosa?


Questo è il codice completo

Set PivotTable1 = CreateObject("OWC.PivotTable")
PivotTable1.ConnectionString = Application("ConnectionString")
PivotTable1.CommandText = "SELECT * from Tabella"

' Get variables from the pivot table
Set view = PivotTable1.ActiveView
Set fsets = PivotTable1.ActiveView.FieldSets
Set c = PivotTable1.Constants

' Add Category to the Row axis and Item to the Column axis
view.RowAxis.InsertFieldSet fsets("Operatore")
view.RowAxis.InsertFieldSet fsets("Tipo")

' Add a new total - Sum of Price
Set newtotal = view.AddTotal("Sum of costo", view.FieldSets("costo").Fields(0), c.plFunctionSum)
view.DataAxis.InsertTotal newtotal
view.DataAxis.InsertFieldSet view.FieldSets("costo")

PivotTable1.Refresh

' Set some visual properties
PivotTable1.DisplayExpandIndicator = True
PivotTable1.DisplayFieldList = True
PivotTable1.Refresh


response.write PivotTable1.htmlData