Microsoft.Office.Interop.OWC - Unspecified error

R

Reinfried

I want to work with Office XP Primary Interop Assemlies (Office XP PIA) with Visual Studio.Net 2003.

I want to build an OLAP Reporting Application in ASP.NET Using SQL Server 2000 Analysis Services
and Office XP OWC (PivotTables and Charts).

I have create a new project with Visual Studio.Net 2003. But only the connecting to the OLAP Cube and
the behaviors of the PivotTable are work correct.

All other function like ColumnAxis,RowAxis,FilterAxis,DataAxis ... getting an error!

This is the error message:

<err>Microsoft.Office.Interop.OWC - Unspecified error </err>

I have installed now a new PC with ( but the same errors are shown):

Windows XP Professional with SP1
Office XP with SP3
Office XP PIAs
MS Analysis Service with SP3
Visual Studio Net 2003 incl. .Net Framwork 1.1
MDAC 2.8

I have test the project now, but I am getting the same errors.

I have the PIAs registered with register.bat on the Visual Studio .NET Command Prompt. The PIAs exists in the GCA.

I have set the reference to OWC in the Project menu of Visual Studio Net 2003.
References to

adodb
MSComctlLIB
MSDATASRC
OWC10
stdole

are set:

C:\WINDOWS\assembly\GAC\ADODB\7.0.3300.0__b03f5f7f11d50a3a\ADODB.dll
C:\WINDOWS\assembly\GAC\mscomctl\10.0.4504.0__31bf3856ad364e35\mscomctl.dll
C:\WINDOWS\assembly\GAC\MSDATASRC\7.0.3300.0__b03f5f7f11d50a3a\MSDATASRC.dll
C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.Owc\10.0.4504.0__31bf3856ad364e35\Microsoft.Office.Interop.Owc.dll
C:\WINDOWS\assembly\GAC\stdole\7.0.3300.0__b03f5f7f11d50a3a\stdole.dll


I have tested with and without follwing configuration:
I have add a line in the machine.config under the <assemblies> section:
<add assmbly="Microsoft.Office.Interop.OWC, Version=10.0.4504.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35"/>

In the web.config I have set the connectionstring to OLAP:

<appSettings>
<add key="OLAPConnectionString" value="Provider=MSOLAP.2;Data Source=localhost;Initial Catalog=Foodmart 2000;" />
</appSettings>


In the code I have set

Imports OWC10 = Microsoft.Office.Interop.OWC
<WebMethod()> Public Function InitializePivotTableXML(ByVal strDataMember As String) As String
Dim m_XML As String
Dim strOLAPConn As String = ConfigurationSettings.AppSettings("OLAPConnectionString")
Dim objPTView As OWC10.PivotView
Try
Dim objPT As OWC10.PivotTableClass = New OWC10.PivotTableClass
objPT.ConnectionString = strOLAPConn
objPT.DataMember = strDataMember
objPTView = objPT.ActiveView
objPTView.TitleBar.Caption = "OLAP Reporting ...."
' define the measures
objPTView.DataAxis.InsertTotal(objPTView.Totals("Unit Sales"))
objPTView.DataAxis.InsertTotal(objPTView.Totals("Store Sales"))
objPTView.DataAxis.Totals("Store Sales").NumberFormat = "Currency"
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

On
objPTView.DataAxis.InsertTotal(objPTView.Totals("Unit Sales"))
now I have also the following error:

<err>Microsoft.Office.Interop.OWC - Unspecified error </err>

All functions like ColumnAxis,RowAxis,FilterAxis,DataAxis ... getting an error!

All bahaviors like:

objPT.ConnectionString = strOLAPConn
objPT.DataMember = strDataMember

objPT.DisplayFieldList = False

objPT.MaxHeight = 650
objPT.MaxWidth = 1240
objPTView = objPT.ActiveView

With objPTView.TitleBar
.Caption = "OLAP Reporting ...."
.Font.Color = "White"
.Font.Name = "Verdana"
.Font.Size = 12
.BackColor = "gray"
End With

works correct.

In the OWC10.aspx.vb I have for test follwing code, so in WebServices i don't get details:

Imports owc10 = Microsoft.Office.Interop.OWC
Public Class WebForm1
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub

'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim strOLAPConn As String = ConfigurationSettings.AppSettings("OLAPConnectionString")
Dim objPTView As owc10.PivotView
Dim objPT As OWC10.PivotTableClass = New OWC10.PivotTableClass

If Not IsPostBack Then
objPT.ConnectionString = strOLAPConn
objPT.DataMember = "Sales"
objPTView = objPT.ActiveView
objPTView.TitleBar.Caption = "OLAP Reporting ....."
' define the measures
'objPTView.DataAxis.InsertTotal(objPTView.Totals("Unit Sales"))
objPTView.DataAxis.InsertTotal(objPTView.Totals("Store Sales"))
'objPTView.DataAxis.Totals("Store Sales").NumberFormat = "Currency"
objPT = Nothing
End If
End Sub

End Class


This is the result:


Serverfehler in der Anwendung '/OfficeXPPIATest'.
--------------------------------------------------------------------------------

Unbekannter Fehler
Beschreibung: Beim Ausführen der aktuellen Webanforderung ist ein unverarbeiteter Fehler aufgetreten. Überprüfen Sie die Stapelüberwachung, um weitere

Informationen über diesen Fehler anzuzeigen und festzustellen, wo der Fehler im Code verursacht wurde.

Ausnahmedetails: System.Runtime.InteropServices.COMException: Unbekannter Fehler

Quellfehler:


Zeile 35: ' define the measures
Zeile 36: 'objPTView.DataAxis.InsertTotal(objPTView.Totals("Unit Sales"))
Zeile 37: objPTView.DataAxis.InsertTotal(objPTView.Totals("Store Sales"))
Zeile 38: 'objPTView.DataAxis.Totals("Store Sales").NumberFormat = "Currency"
Zeile 39: objPT = Nothing


Quelldatei: C:\Inetpub\wwwroot\OfficeXPPIATest\owc10.aspx.vb Zeile: 37

Stapelüberwachung:


[COMException (0x80004005): Unbekannter Fehler]
Microsoft.Office.Interop.OWC.PivotView.get_Totals() +0
OfficeXPPIATest.WebForm1.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\OfficeXPPIATest\owc10.aspx.vb:37
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()




--------------------------------------------------------------------------------
Versionsinformationen: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET-Version:1.1.4322.573


Have anywhere an idea what's the problem is ?

Many Thanks !!!!!
 
R

Reinfried

Hurra!!!!!!!

The solution is very simple:

The User ASPNET (ASP.NET Machine Account) must be a member of OLAP Administrator.

Reinfried said:
I want to work with Office XP Primary Interop Assemlies (Office XP PIA) with Visual Studio.Net 2003.

I want to build an OLAP Reporting Application in ASP.NET Using SQL Server 2000 Analysis Services
and Office XP OWC (PivotTables and Charts).

I have create a new project with Visual Studio.Net 2003. But only the connecting to the OLAP Cube and
the behaviors of the PivotTable are work correct.

All other function like ColumnAxis,RowAxis,FilterAxis,DataAxis ... getting an error!

This is the error message:

<err>Microsoft.Office.Interop.OWC - Unspecified error </err>

I have installed now a new PC with ( but the same errors are shown):

Windows XP Professional with SP1
Office XP with SP3
Office XP PIAs
MS Analysis Service with SP3
Visual Studio Net 2003 incl. .Net Framwork 1.1
MDAC 2.8

I have test the project now, but I am getting the same errors.

I have the PIAs registered with register.bat on the Visual Studio .NET Command Prompt. The PIAs exists in the GCA.

I have set the reference to OWC in the Project menu of Visual Studio Net 2003.
References to

adodb
MSComctlLIB
MSDATASRC
OWC10
stdole

are set:

C:\WINDOWS\assembly\GAC\ADODB\7.0.3300.0__b03f5f7f11d50a3a\ADODB.dll
C:\WINDOWS\assembly\GAC\mscomctl\10.0.4504.0__31bf3856ad364e35\mscomctl.dll
C:\WINDOWS\assembly\GAC\MSDATASRC\7.0.3300.0__b03f5f7f11d50a3a\MSDATASRC.dll
C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.Owc\10.0.4504.0__31bf3856ad364e35\Microsoft.Office.Interop.Owc.dll
C:\WINDOWS\assembly\GAC\stdole\7.0.3300.0__b03f5f7f11d50a3a\stdole.dll


I have tested with and without follwing configuration:
I have add a line in the machine.config under the <assemblies> section:
<add assmbly="Microsoft.Office.Interop.OWC, Version=10.0.4504.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35"/>

In the web.config I have set the connectionstring to OLAP:

<appSettings>
<add key="OLAPConnectionString" value="Provider=MSOLAP.2;Data Source=localhost;Initial Catalog=Foodmart 2000;" />
</appSettings>


In the code I have set

Imports OWC10 = Microsoft.Office.Interop.OWC
<WebMethod()> Public Function InitializePivotTableXML(ByVal strDataMember As String) As String
Dim m_XML As String
Dim strOLAPConn As String = ConfigurationSettings.AppSettings("OLAPConnectionString")
Dim objPTView As OWC10.PivotView
Try
Dim objPT As OWC10.PivotTableClass = New OWC10.PivotTableClass
objPT.ConnectionString = strOLAPConn
objPT.DataMember = strDataMember
objPTView = objPT.ActiveView
objPTView.TitleBar.Caption = "OLAP Reporting ...."
' define the measures
objPTView.DataAxis.InsertTotal(objPTView.Totals("Unit Sales"))
objPTView.DataAxis.InsertTotal(objPTView.Totals("Store Sales"))
objPTView.DataAxis.Totals("Store Sales").NumberFormat = "Currency"
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

On
objPTView.DataAxis.InsertTotal(objPTView.Totals("Unit Sales"))
now I have also the following error:

<err>Microsoft.Office.Interop.OWC - Unspecified error </err>

All functions like ColumnAxis,RowAxis,FilterAxis,DataAxis ... getting an error!

All bahaviors like:

objPT.ConnectionString = strOLAPConn
objPT.DataMember = strDataMember

objPT.DisplayFieldList = False

objPT.MaxHeight = 650
objPT.MaxWidth = 1240
objPTView = objPT.ActiveView

With objPTView.TitleBar
.Caption = "OLAP Reporting ...."
.Font.Color = "White"
.Font.Name = "Verdana"
.Font.Size = 12
.BackColor = "gray"
End With

works correct.

In the OWC10.aspx.vb I have for test follwing code, so in WebServices i don't get details:

Imports owc10 = Microsoft.Office.Interop.OWC
Public Class WebForm1
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub

'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim strOLAPConn As String = ConfigurationSettings.AppSettings("OLAPConnectionString")
Dim objPTView As owc10.PivotView
Dim objPT As OWC10.PivotTableClass = New OWC10.PivotTableClass

If Not IsPostBack Then
objPT.ConnectionString = strOLAPConn
objPT.DataMember = "Sales"
objPTView = objPT.ActiveView
objPTView.TitleBar.Caption = "OLAP Reporting ....."
' define the measures
'objPTView.DataAxis.InsertTotal(objPTView.Totals("Unit Sales"))
objPTView.DataAxis.InsertTotal(objPTView.Totals("Store Sales"))
'objPTView.DataAxis.Totals("Store Sales").NumberFormat = "Currency"
objPT = Nothing
End If
End Sub

End Class


This is the result:


Serverfehler in der Anwendung '/OfficeXPPIATest'.
--------------------------------------------------------------------------------

Unbekannter Fehler
Beschreibung: Beim Ausführen der aktuellen Webanforderung ist ein unverarbeiteter Fehler aufgetreten. Überprüfen Sie die Stapelüberwachung, um weitere

Informationen über diesen Fehler anzuzeigen und festzustellen, wo der Fehler im Code verursacht wurde.

Ausnahmedetails: System.Runtime.InteropServices.COMException: Unbekannter Fehler

Quellfehler:


Zeile 35: ' define the measures
Zeile 36: 'objPTView.DataAxis.InsertTotal(objPTView.Totals("Unit Sales"))
Zeile 37: objPTView.DataAxis.InsertTotal(objPTView.Totals("Store Sales"))
Zeile 38: 'objPTView.DataAxis.Totals("Store Sales").NumberFormat = "Currency"
Zeile 39: objPT = Nothing


Quelldatei: C:\Inetpub\wwwroot\OfficeXPPIATest\owc10.aspx.vb Zeile: 37

Stapelüberwachung:


[COMException (0x80004005): Unbekannter Fehler]
Microsoft.Office.Interop.OWC.PivotView.get_Totals() +0
OfficeXPPIATest.WebForm1.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\OfficeXPPIATest\owc10.aspx.vb:37
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()




--------------------------------------------------------------------------------
Versionsinformationen: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET-Version:1.1.4322.573


Have anywhere an idea what's the problem is ?

Many Thanks !!!!!
 

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