OWC11 ASP.NET PivotView

V

Vanessa Berni

Hi all,
I've function that "should" load a custom pivot table report (it returns the
"xml stream")

I've a generic error when I execute the line
objPTView.ColumnAxis.InsertFieldSet(objPTView.FieldSets("Time"))

Looking inside my PivotTableClass (objPT) there are errors in several
properties
objPT.ActiveData, objPT.Connection ... <error: an exception of type:
{System.Runtime.InteropServices.COMException} occurred>
Microsoft.Office.Interop.Owc11.PivotFieldSets

Do you have any suggestion?

Thanks a lot.
Vanessa

Public Function LoadCustomPivotTableReport(ByVal strCity1 As String, ByVal
strCity2 As String) As String
Dim m_XML As String

Dim strOLAPConn As String =
ConfigurationSettings.AppSettings("OLAPConnectionString")
Dim objPT As PivotTableClass = New PivotTableClass
Dim objPTView As PivotView

Try
' set the connection string and data member
objPT.ConnectionString = strOLAPConn
objPT.DataMember = MyDataMember
objPT.AllowFiltering = True

objPTView = objPT.ActiveView
objPTView.TitleBar.Caption = "Comparison"

' define the column elements
objPTView.ColumnAxis.InsertFieldSet(objPTView.FieldSets("Time"))
'objPTView.ColumnAxis.FieldSets("Time").Fields("Year").Expanded
= True

[CUT] //here i customize my Pivot Table

m_XML = objPT.XMLData

objPT = Nothing

Catch err As Exception
m_XML = "<err>" & err.Source & " - " & err.Message & "</err>"
Finally

End Try

Return (m_XML)
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top