Alvin, Thao where are you? OWC interop problems in .Net

T

TJCube

Hi All

I have just started converting my classic ASP web pages for office web
components to .net. I found this wonderful article on the MS site entitled
"Build an OLAP Reporting App in ASP.NET using SQL Server 2000 Analysis
Services and Office XP. I have created a project in .Net and everything works
fine .. EXCEPT for one thing.

I am getting the following error message "Interop.Owc10 - Unspecified error"
when accessing some of the properties and methods of the OWC10.dll class. I
have been searching for a solution on the net and I am hoping that this forum
can help. Below is the sample code for the LoadCustomPivotTableReport
WebMethod provided with the above article. Everything works fine until the
line starting 'define the column elements'. I am getting the same error if I
convert the code to c#.

<WebMethod()> 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
Dim fldCity, fldName, fldProdFamily As PivotField
Dim fSetCustomers, fSetProduct As PivotFieldSet

Try
' set the connection string and data member
objPT.ConnectionString = strOLAPConn
objPT.DataMember = "Sales"
'objPT.AllowPropertyToolbox = False
objPT.AllowFiltering = False

objPTView = objPT.ActiveView
objPTView.TitleBar.Caption = "City Comparison of Drink Sales"

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

' define the row elements
fSetCustomers = objPTView.FieldSets("Customers")
objPTView.RowAxis.InsertFieldSet(fSetCustomers)
fSetCustomers.Fields("Country").IsIncluded = False
fSetCustomers.Fields("State Province").IsIncluded = False
fSetCustomers.Fields("Name").IsIncluded = False

' define the members of the row elements
fldCity = fSetCustomers.Fields("City")
fldCity.IncludedMembers = New Object() {strCity1, strCity2}

' exclude all other field row members in the fieldset
fSetProduct = objPTView.FieldSets("Product")
objPTView.RowAxis.InsertFieldSet(fSetProduct)
fSetProduct.Fields("Product Department").IsIncluded = False
fSetProduct.Fields("Product Category").IsIncluded = False
fSetProduct.Fields("Product Subcategory").IsIncluded = False
fSetProduct.Fields("Brand Name").IsIncluded = False
fSetProduct.Fields("Product Name").IsIncluded = False

'fldProdFamily = fSetProduct.Fields("Product Family")
fldProdFamily.IncludedMembers = "Drink"

' define the measures
objPTView.DataAxis.InsertTotal(objPTView.Totals("Unit Sales"))
objPTView.DataAxis.InsertTotal(objPTView.Totals("Store Sales"))
objPTView.DataAxis.Totals("Store Sales").NumberFormat = "Currency"

Dim ChartSpace1 As ChartSpaceClass = New ChartSpaceClass
ChartSpace1.Charts(0).Type() = ChartChartTypeEnum.chChartTypeBar3D


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
 
L

Luis D Rojas

Have you identify what propoerty is failing?

TJCube said:
Hi All

I have just started converting my classic ASP web pages for office web
components to .net. I found this wonderful article on the MS site entitled
"Build an OLAP Reporting App in ASP.NET using SQL Server 2000 Analysis
Services and Office XP. I have created a project in .Net and everything works
fine .. EXCEPT for one thing.

I am getting the following error message "Interop.Owc10 - Unspecified error"
when accessing some of the properties and methods of the OWC10.dll class. I
have been searching for a solution on the net and I am hoping that this forum
can help. Below is the sample code for the LoadCustomPivotTableReport
WebMethod provided with the above article. Everything works fine until the
line starting 'define the column elements'. I am getting the same error if I
convert the code to c#.

<WebMethod()> 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
Dim fldCity, fldName, fldProdFamily As PivotField
Dim fSetCustomers, fSetProduct As PivotFieldSet

Try
' set the connection string and data member
objPT.ConnectionString = strOLAPConn
objPT.DataMember = "Sales"
'objPT.AllowPropertyToolbox = False
objPT.AllowFiltering = False

objPTView = objPT.ActiveView
objPTView.TitleBar.Caption = "City Comparison of Drink Sales"

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

' define the row elements
fSetCustomers = objPTView.FieldSets("Customers")
objPTView.RowAxis.InsertFieldSet(fSetCustomers)
fSetCustomers.Fields("Country").IsIncluded = False
fSetCustomers.Fields("State Province").IsIncluded = False
fSetCustomers.Fields("Name").IsIncluded = False

' define the members of the row elements
fldCity = fSetCustomers.Fields("City")
fldCity.IncludedMembers = New Object() {strCity1, strCity2}

' exclude all other field row members in the fieldset
fSetProduct = objPTView.FieldSets("Product")
objPTView.RowAxis.InsertFieldSet(fSetProduct)
fSetProduct.Fields("Product Department").IsIncluded = False
fSetProduct.Fields("Product Category").IsIncluded = False
fSetProduct.Fields("Product Subcategory").IsIncluded = False
fSetProduct.Fields("Brand Name").IsIncluded = False
fSetProduct.Fields("Product Name").IsIncluded = False

'fldProdFamily = fSetProduct.Fields("Product Family")
fldProdFamily.IncludedMembers = "Drink"

' define the measures
objPTView.DataAxis.InsertTotal(objPTView.Totals("Unit Sales"))
objPTView.DataAxis.InsertTotal(objPTView.Totals("Store Sales"))
objPTView.DataAxis.Totals("Store Sales").NumberFormat = "Currency"

Dim ChartSpace1 As ChartSpaceClass = New ChartSpaceClass
ChartSpace1.Charts(0).Type() = ChartChartTypeEnum.chChartTypeBar3D


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
 
A

Alvin Bruney [ASP.NET MVP]

we are not here, but leave a message and we will get back to u

This sounds like either a registration issue or a permissions problem. As
luis said, you need to verify what properties are working. Your first step
is to re-install the OWC and then try again.
 
T

TJCube

Hi Alvin

Thanks for the response.

I am communicating with OWC via a web method. The following lines of code
work:

string strOLAPConn =
ConfigurationSettings.AppSettings["OLAPConnectionString"];
PivotTableClass objPT = new PivotTableClass();
objPT.ConnectionString = strOLAPConn;
objPT.DataMember = strCube;
PivotView objView = objPT.ActiveView;

and then this line causes the problem:
objView.RowAxis.InsertFieldSet(objView.FieldSets[0],0,true);

My web server is my local machine and I am connecting to a cube on one of
our production servers. I have reinstalled OWC on my machine (i.e. the local
server) and also made ASPNET part of the OLAP Administrators group on my
machine. Do I need to do anything to the server containing the cube that I am
connecting to, hopefully not because this server does not have anythign .NET
related installed on it.

Another thing when I debug the code and put a watch on the objView object,
the Fieldset value reads: FieldSets <error: an exception of type:
{System.Runtime.InteropServices.COMException} occurred> OWC10.PivotFieldSets

This message is also on the Totals property of objView. All other properties
seem fine and contain values where they should.

Hopefully you have some answer to this chaos.

Thanks
 
A

Alvin Bruney [ASP.NET MVP]

did you re-install?
TJCube said:
Hi Alvin

Thanks for the response.

I am communicating with OWC via a web method. The following lines of code
work:

string strOLAPConn =
ConfigurationSettings.AppSettings["OLAPConnectionString"];
PivotTableClass objPT = new PivotTableClass();
objPT.ConnectionString = strOLAPConn;
objPT.DataMember = strCube;
PivotView objView = objPT.ActiveView;

and then this line causes the problem:
objView.RowAxis.InsertFieldSet(objView.FieldSets[0],0,true);

My web server is my local machine and I am connecting to a cube on one of
our production servers. I have reinstalled OWC on my machine (i.e. the
local
server) and also made ASPNET part of the OLAP Administrators group on my
machine. Do I need to do anything to the server containing the cube that I
am
connecting to, hopefully not because this server does not have anythign
.NET
related installed on it.

Another thing when I debug the code and put a watch on the objView object,
the Fieldset value reads: FieldSets <error: an exception of type:
{System.Runtime.InteropServices.COMException} occurred>
OWC10.PivotFieldSets

This message is also on the Totals property of objView. All other
properties
seem fine and contain values where they should.

Hopefully you have some answer to this chaos.

Thanks


Alvin Bruney said:
we are not here, but leave a message and we will get back to u

This sounds like either a registration issue or a permissions problem. As
luis said, you need to verify what properties are working. Your first
step
is to re-install the OWC and then try again.
 
T

TJCube

Yes, I reinstalled OWC 10 on my machine which is the local server in my case.
I did not reinstall OWC on the server where the cube is located, cause its
the production server and I did not want to bring it down during the day.
Anyway, I am not sure that OWC is neccessary on the server where the cube is
located, only on the web server - isnt it?

Alvin Bruney said:
did you re-install?
TJCube said:
Hi Alvin

Thanks for the response.

I am communicating with OWC via a web method. The following lines of code
work:

string strOLAPConn =
ConfigurationSettings.AppSettings["OLAPConnectionString"];
PivotTableClass objPT = new PivotTableClass();
objPT.ConnectionString = strOLAPConn;
objPT.DataMember = strCube;
PivotView objView = objPT.ActiveView;

and then this line causes the problem:
objView.RowAxis.InsertFieldSet(objView.FieldSets[0],0,true);

My web server is my local machine and I am connecting to a cube on one of
our production servers. I have reinstalled OWC on my machine (i.e. the
local
server) and also made ASPNET part of the OLAP Administrators group on my
machine. Do I need to do anything to the server containing the cube that I
am
connecting to, hopefully not because this server does not have anythign
.NET
related installed on it.

Another thing when I debug the code and put a watch on the objView object,
the Fieldset value reads: FieldSets <error: an exception of type:
{System.Runtime.InteropServices.COMException} occurred>
OWC10.PivotFieldSets

This message is also on the Totals property of objView. All other
properties
seem fine and contain values where they should.

Hopefully you have some answer to this chaos.

Thanks


Alvin Bruney said:
we are not here, but leave a message and we will get back to u

This sounds like either a registration issue or a permissions problem. As
luis said, you need to verify what properties are working. Your first
step
is to re-install the OWC and then try again.

Hi All

I have just started converting my classic ASP web pages for office web
components to .net. I found this wonderful article on the MS site
entitled
"Build an OLAP Reporting App in ASP.NET using SQL Server 2000 Analysis
Services and Office XP. I have created a project in .Net and everything
works
fine .. EXCEPT for one thing.

I am getting the following error message "Interop.Owc10 - Unspecified
error"
when accessing some of the properties and methods of the OWC10.dll
class.
I
have been searching for a solution on the net and I am hoping that this
forum
can help. Below is the sample code for the LoadCustomPivotTableReport
WebMethod provided with the above article. Everything works fine until
the
line starting 'define the column elements'. I am getting the same error
if
I
convert the code to c#.

<WebMethod()> 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
Dim fldCity, fldName, fldProdFamily As PivotField
Dim fSetCustomers, fSetProduct As PivotFieldSet

Try
' set the connection string and data member
objPT.ConnectionString = strOLAPConn
objPT.DataMember = "Sales"
'objPT.AllowPropertyToolbox = False
objPT.AllowFiltering = False

objPTView = objPT.ActiveView
objPTView.TitleBar.Caption = "City Comparison of Drink
Sales"

' define the column elements

objPTView.ColumnAxis.InsertFieldSet(objPTView.FieldSets("Time"))

objPTView.ColumnAxis.FieldSets("Time").Fields("Year").Expanded
=
True

' define the row elements
fSetCustomers = objPTView.FieldSets("Customers")
objPTView.RowAxis.InsertFieldSet(fSetCustomers)
fSetCustomers.Fields("Country").IsIncluded = False
fSetCustomers.Fields("State Province").IsIncluded = False
fSetCustomers.Fields("Name").IsIncluded = False

' define the members of the row elements
fldCity = fSetCustomers.Fields("City")
fldCity.IncludedMembers = New Object() {strCity1, strCity2}

' exclude all other field row members in the fieldset
fSetProduct = objPTView.FieldSets("Product")
objPTView.RowAxis.InsertFieldSet(fSetProduct)
fSetProduct.Fields("Product Department").IsIncluded = False
fSetProduct.Fields("Product Category").IsIncluded = False
fSetProduct.Fields("Product Subcategory").IsIncluded =
False
fSetProduct.Fields("Brand Name").IsIncluded = False
fSetProduct.Fields("Product Name").IsIncluded = False

'fldProdFamily = fSetProduct.Fields("Product Family")
fldProdFamily.IncludedMembers = "Drink"

' define the measures
objPTView.DataAxis.InsertTotal(objPTView.Totals("Unit
Sales"))
objPTView.DataAxis.InsertTotal(objPTView.Totals("Store
Sales"))
objPTView.DataAxis.Totals("Store Sales").NumberFormat =
"Currency"

Dim ChartSpace1 As ChartSpaceClass = New ChartSpaceClass
ChartSpace1.Charts(0).Type() =
ChartChartTypeEnum.chChartTypeBar3D


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
 
T

TJCube

Alvin, some more information:

I decided to try to get my code working using client side code to talk to
the Pivot table object (objPivotTable in my asp page). This following code
works:

var l_oCube = document.objPivotTable;
var l_oView = l_oCube.ActiveView;
l_oCube.ConnectionString = 'Provider=MSOLAP.2;secured cell value=3;Persist
Security Info=True;User ID=biwnetadmin;Data Source=CTEIW;Initial
Catalog=ERIC;Client Cache Size=25;Auto Synch Period=10000';
l_oCube.DataMember = "Sales";
l_oView.RowAxis.InsertFieldSet(l_oView.FieldSets("Site"));

but when I create this code as a web service using server side code as per
one of my earlier posts, it fails.

Curioser and Curiouser, but I need to pull the rabit out of the hat on this
one ..

TJCube said:
Yes, I reinstalled OWC 10 on my machine which is the local server in my case.
I did not reinstall OWC on the server where the cube is located, cause its
the production server and I did not want to bring it down during the day.
Anyway, I am not sure that OWC is neccessary on the server where the cube is
located, only on the web server - isnt it?

Alvin Bruney said:
did you re-install?
TJCube said:
Hi Alvin

Thanks for the response.

I am communicating with OWC via a web method. The following lines of code
work:

string strOLAPConn =
ConfigurationSettings.AppSettings["OLAPConnectionString"];
PivotTableClass objPT = new PivotTableClass();
objPT.ConnectionString = strOLAPConn;
objPT.DataMember = strCube;
PivotView objView = objPT.ActiveView;

and then this line causes the problem:
objView.RowAxis.InsertFieldSet(objView.FieldSets[0],0,true);

My web server is my local machine and I am connecting to a cube on one of
our production servers. I have reinstalled OWC on my machine (i.e. the
local
server) and also made ASPNET part of the OLAP Administrators group on my
machine. Do I need to do anything to the server containing the cube that I
am
connecting to, hopefully not because this server does not have anythign
.NET
related installed on it.

Another thing when I debug the code and put a watch on the objView object,
the Fieldset value reads: FieldSets <error: an exception of type:
{System.Runtime.InteropServices.COMException} occurred>
OWC10.PivotFieldSets

This message is also on the Totals property of objView. All other
properties
seem fine and contain values where they should.

Hopefully you have some answer to this chaos.

Thanks


:

we are not here, but leave a message and we will get back to u

This sounds like either a registration issue or a permissions problem. As
luis said, you need to verify what properties are working. Your first
step
is to re-install the OWC and then try again.

Hi All

I have just started converting my classic ASP web pages for office web
components to .net. I found this wonderful article on the MS site
entitled
"Build an OLAP Reporting App in ASP.NET using SQL Server 2000 Analysis
Services and Office XP. I have created a project in .Net and everything
works
fine .. EXCEPT for one thing.

I am getting the following error message "Interop.Owc10 - Unspecified
error"
when accessing some of the properties and methods of the OWC10.dll
class.
I
have been searching for a solution on the net and I am hoping that this
forum
can help. Below is the sample code for the LoadCustomPivotTableReport
WebMethod provided with the above article. Everything works fine until
the
line starting 'define the column elements'. I am getting the same error
if
I
convert the code to c#.

<WebMethod()> 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
Dim fldCity, fldName, fldProdFamily As PivotField
Dim fSetCustomers, fSetProduct As PivotFieldSet

Try
' set the connection string and data member
objPT.ConnectionString = strOLAPConn
objPT.DataMember = "Sales"
'objPT.AllowPropertyToolbox = False
objPT.AllowFiltering = False

objPTView = objPT.ActiveView
objPTView.TitleBar.Caption = "City Comparison of Drink
Sales"

' define the column elements

objPTView.ColumnAxis.InsertFieldSet(objPTView.FieldSets("Time"))

objPTView.ColumnAxis.FieldSets("Time").Fields("Year").Expanded
=
True

' define the row elements
fSetCustomers = objPTView.FieldSets("Customers")
objPTView.RowAxis.InsertFieldSet(fSetCustomers)
fSetCustomers.Fields("Country").IsIncluded = False
fSetCustomers.Fields("State Province").IsIncluded = False
fSetCustomers.Fields("Name").IsIncluded = False

' define the members of the row elements
fldCity = fSetCustomers.Fields("City")
fldCity.IncludedMembers = New Object() {strCity1, strCity2}

' exclude all other field row members in the fieldset
fSetProduct = objPTView.FieldSets("Product")
objPTView.RowAxis.InsertFieldSet(fSetProduct)
fSetProduct.Fields("Product Department").IsIncluded = False
fSetProduct.Fields("Product Category").IsIncluded = False
fSetProduct.Fields("Product Subcategory").IsIncluded =
False
fSetProduct.Fields("Brand Name").IsIncluded = False
fSetProduct.Fields("Product Name").IsIncluded = False

'fldProdFamily = fSetProduct.Fields("Product Family")
fldProdFamily.IncludedMembers = "Drink"

' define the measures
objPTView.DataAxis.InsertTotal(objPTView.Totals("Unit
Sales"))
objPTView.DataAxis.InsertTotal(objPTView.Totals("Store
Sales"))
objPTView.DataAxis.Totals("Store Sales").NumberFormat =
"Currency"

Dim ChartSpace1 As ChartSpaceClass = New ChartSpaceClass
ChartSpace1.Charts(0).Type() =
ChartChartTypeEnum.chChartTypeBar3D


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
 
A

Alvin Bruney [ASP.NET MVP]

you need to look at the com exception. it contains more detail, post the
exact error message - for instance it may give an hr error code or an
additional string if you search the exception object using the debugger

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_________________________


TJCube said:
Alvin, some more information:

I decided to try to get my code working using client side code to talk to
the Pivot table object (objPivotTable in my asp page). This following code
works:

var l_oCube = document.objPivotTable;
var l_oView = l_oCube.ActiveView;
l_oCube.ConnectionString = 'Provider=MSOLAP.2;secured cell value=3;Persist
Security Info=True;User ID=biwnetadmin;Data Source=CTEIW;Initial
Catalog=ERIC;Client Cache Size=25;Auto Synch Period=10000';
l_oCube.DataMember = "Sales";
l_oView.RowAxis.InsertFieldSet(l_oView.FieldSets("Site"));

but when I create this code as a web service using server side code as per
one of my earlier posts, it fails.

Curioser and Curiouser, but I need to pull the rabit out of the hat on
this
one ..

TJCube said:
Yes, I reinstalled OWC 10 on my machine which is the local server in my
case.
I did not reinstall OWC on the server where the cube is located, cause
its
the production server and I did not want to bring it down during the day.
Anyway, I am not sure that OWC is neccessary on the server where the cube
is
located, only on the web server - isnt it?

Alvin Bruney said:
did you re-install?
Hi Alvin

Thanks for the response.

I am communicating with OWC via a web method. The following lines of
code
work:

string strOLAPConn =
ConfigurationSettings.AppSettings["OLAPConnectionString"];
PivotTableClass objPT = new PivotTableClass();
objPT.ConnectionString = strOLAPConn;
objPT.DataMember = strCube;
PivotView objView = objPT.ActiveView;

and then this line causes the problem:
objView.RowAxis.InsertFieldSet(objView.FieldSets[0],0,true);

My web server is my local machine and I am connecting to a cube on
one of
our production servers. I have reinstalled OWC on my machine (i.e.
the
local
server) and also made ASPNET part of the OLAP Administrators group on
my
machine. Do I need to do anything to the server containing the cube
that I
am
connecting to, hopefully not because this server does not have
anythign
.NET
related installed on it.

Another thing when I debug the code and put a watch on the objView
object,
the Fieldset value reads: FieldSets <error: an exception of type:
{System.Runtime.InteropServices.COMException} occurred>
OWC10.PivotFieldSets

This message is also on the Totals property of objView. All other
properties
seem fine and contain values where they should.

Hopefully you have some answer to this chaos.

Thanks


:

we are not here, but leave a message and we will get back to u

This sounds like either a registration issue or a permissions
problem. As
luis said, you need to verify what properties are working. Your
first
step
is to re-install the OWC and then try again.

Hi All

I have just started converting my classic ASP web pages for office
web
components to .net. I found this wonderful article on the MS site
entitled
"Build an OLAP Reporting App in ASP.NET using SQL Server 2000
Analysis
Services and Office XP. I have created a project in .Net and
everything
works
fine .. EXCEPT for one thing.

I am getting the following error message "Interop.Owc10 -
Unspecified
error"
when accessing some of the properties and methods of the OWC10.dll
class.
I
have been searching for a solution on the net and I am hoping that
this
forum
can help. Below is the sample code for the
LoadCustomPivotTableReport
WebMethod provided with the above article. Everything works fine
until
the
line starting 'define the column elements'. I am getting the same
error
if
I
convert the code to c#.

<WebMethod()> 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
Dim fldCity, fldName, fldProdFamily As PivotField
Dim fSetCustomers, fSetProduct As PivotFieldSet

Try
' set the connection string and data member
objPT.ConnectionString = strOLAPConn
objPT.DataMember = "Sales"
'objPT.AllowPropertyToolbox = False
objPT.AllowFiltering = False

objPTView = objPT.ActiveView
objPTView.TitleBar.Caption = "City Comparison of Drink
Sales"

' define the column elements

objPTView.ColumnAxis.InsertFieldSet(objPTView.FieldSets("Time"))

objPTView.ColumnAxis.FieldSets("Time").Fields("Year").Expanded
=
True

' define the row elements
fSetCustomers = objPTView.FieldSets("Customers")
objPTView.RowAxis.InsertFieldSet(fSetCustomers)
fSetCustomers.Fields("Country").IsIncluded = False
fSetCustomers.Fields("State Province").IsIncluded =
False
fSetCustomers.Fields("Name").IsIncluded = False

' define the members of the row elements
fldCity = fSetCustomers.Fields("City")
fldCity.IncludedMembers = New Object() {strCity1,
strCity2}

' exclude all other field row members in the fieldset
fSetProduct = objPTView.FieldSets("Product")
objPTView.RowAxis.InsertFieldSet(fSetProduct)
fSetProduct.Fields("Product Department").IsIncluded =
False
fSetProduct.Fields("Product Category").IsIncluded =
False
fSetProduct.Fields("Product Subcategory").IsIncluded =
False
fSetProduct.Fields("Brand Name").IsIncluded = False
fSetProduct.Fields("Product Name").IsIncluded = False

'fldProdFamily = fSetProduct.Fields("Product Family")
fldProdFamily.IncludedMembers = "Drink"

' define the measures
objPTView.DataAxis.InsertTotal(objPTView.Totals("Unit
Sales"))
objPTView.DataAxis.InsertTotal(objPTView.Totals("Store
Sales"))
objPTView.DataAxis.Totals("Store Sales").NumberFormat
=
"Currency"

Dim ChartSpace1 As ChartSpaceClass = New
ChartSpaceClass
ChartSpace1.Charts(0).Type() =
ChartChartTypeEnum.chChartTypeBar3D


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
 
T

TJCube

Hi Alvin

Thanks for your help so far, I feel that we are getting closer. Today I have
two more snippets of informaton for you that might help to solve the problem.

Firstly, I have managed to get Analysis Manager setup on my machine as a
local server. So now the web server and analysis server are all on my machine
and my machine is .net friendly. I changed the connection to point to the
local AS server and everything worked like a charm. Unfortunately, I have to
get this working on the production servers (Analysis Manager not web server)
and as I mentioned earlier, this server has nothing .net related on it at all.

Secondly, I looked at the exception class in the debugger. Phew what a lot
of stuff. Here are some of the properties that I thought might be useful:

System.Object = {System.Runtime.InteropServices.COMException}
_COMPlusExceptionCode = 0xe0434f4d
_HResult = 0x80004005
_message = "Unspecified error"
Source = "Interop.OWC10"
StackTrace = " at OWC10.PivotView.get_FieldSets()\r\n at
EngenCube.wsEngenOLAP.InitializePivotTableXML(String strCube) in
c:\\inetpub\\wwwroot\\engencube\\services\\wsengenolap.asmx.cs:line 92"

Here is line 92 onwards of my code (Basically, I am looping through all the
field sets and fields and setting the colours and fonts to the company's
standard look and feel):

for (l_iCountOuter = 0; l_iCountOuter < objView.FieldSets[0].Fields.Count
; l_iCountOuter++)
{
PivotFieldSet l_oFieldSet = objView.FieldSets[l_iCountOuter];
for (l_iCountInner = 0; l_iCountInner < l_oFieldSet.Fields.Count;
l_iCountInner++)
{
PivotField l_oField = l_oFieldSet.Fields[l_iCountInner];
l_oField.GroupedBackColor = c_sSubHeadColor;
l_oField.GroupedFont.Name = "Verdana";
l_oField.GroupedFont.Size = 8;
l_oField.SubtotalBackColor = c_sHeadColor;
l_oField.SubtotalFont.Name = "Verdana";
l_oField.SubtotalFont.Size = 8;
l_oField.SubtotalLabelBackColor = c_sHeadColor;
l_oField.SubtotalLabelFont.Name = "Verdana";
l_oField.SubtotalLabelFont.Size = 8;
l_oField.SubtotalLabelFont.Bold = true;
}
}

Hope this info helps. If you want me to dig deeper into the exception
object, let me know what properties to look for.

Thanks

Alvin Bruney said:
you need to look at the com exception. it contains more detail, post the
exact error message - for instance it may give an hr error code or an
additional string if you search the exception object using the debugger

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_________________________


TJCube said:
Alvin, some more information:

I decided to try to get my code working using client side code to talk to
the Pivot table object (objPivotTable in my asp page). This following code
works:

var l_oCube = document.objPivotTable;
var l_oView = l_oCube.ActiveView;
l_oCube.ConnectionString = 'Provider=MSOLAP.2;secured cell value=3;Persist
Security Info=True;User ID=biwnetadmin;Data Source=CTEIW;Initial
Catalog=ERIC;Client Cache Size=25;Auto Synch Period=10000';
l_oCube.DataMember = "Sales";
l_oView.RowAxis.InsertFieldSet(l_oView.FieldSets("Site"));

but when I create this code as a web service using server side code as per
one of my earlier posts, it fails.

Curioser and Curiouser, but I need to pull the rabit out of the hat on
this
one ..

TJCube said:
Yes, I reinstalled OWC 10 on my machine which is the local server in my
case.
I did not reinstall OWC on the server where the cube is located, cause
its
the production server and I did not want to bring it down during the day.
Anyway, I am not sure that OWC is neccessary on the server where the cube
is
located, only on the web server - isnt it?

:

did you re-install?
Hi Alvin

Thanks for the response.

I am communicating with OWC via a web method. The following lines of
code
work:

string strOLAPConn =
ConfigurationSettings.AppSettings["OLAPConnectionString"];
PivotTableClass objPT = new PivotTableClass();
objPT.ConnectionString = strOLAPConn;
objPT.DataMember = strCube;
PivotView objView = objPT.ActiveView;

and then this line causes the problem:
objView.RowAxis.InsertFieldSet(objView.FieldSets[0],0,true);

My web server is my local machine and I am connecting to a cube on
one of
our production servers. I have reinstalled OWC on my machine (i.e.
the
local
server) and also made ASPNET part of the OLAP Administrators group on
my
machine. Do I need to do anything to the server containing the cube
that I
am
connecting to, hopefully not because this server does not have
anythign
.NET
related installed on it.

Another thing when I debug the code and put a watch on the objView
object,
the Fieldset value reads: FieldSets <error: an exception of type:
{System.Runtime.InteropServices.COMException} occurred>
OWC10.PivotFieldSets

This message is also on the Totals property of objView. All other
properties
seem fine and contain values where they should.

Hopefully you have some answer to this chaos.

Thanks


:

we are not here, but leave a message and we will get back to u

This sounds like either a registration issue or a permissions
problem. As
luis said, you need to verify what properties are working. Your
first
step
is to re-install the OWC and then try again.

Hi All

I have just started converting my classic ASP web pages for office
web
components to .net. I found this wonderful article on the MS site
entitled
"Build an OLAP Reporting App in ASP.NET using SQL Server 2000
Analysis
Services and Office XP. I have created a project in .Net and
everything
works
fine .. EXCEPT for one thing.

I am getting the following error message "Interop.Owc10 -
Unspecified
error"
when accessing some of the properties and methods of the OWC10.dll
class.
I
have been searching for a solution on the net and I am hoping that
this
forum
can help. Below is the sample code for the
LoadCustomPivotTableReport
WebMethod provided with the above article. Everything works fine
until
the
line starting 'define the column elements'. I am getting the same
error
if
I
convert the code to c#.

<WebMethod()> 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
Dim fldCity, fldName, fldProdFamily As PivotField
Dim fSetCustomers, fSetProduct As PivotFieldSet

Try
' set the connection string and data member
objPT.ConnectionString = strOLAPConn
objPT.DataMember = "Sales"
'objPT.AllowPropertyToolbox = False
objPT.AllowFiltering = False

objPTView = objPT.ActiveView
objPTView.TitleBar.Caption = "City Comparison of Drink
Sales"

' define the column elements

objPTView.ColumnAxis.InsertFieldSet(objPTView.FieldSets("Time"))

objPTView.ColumnAxis.FieldSets("Time").Fields("Year").Expanded
=
True

' define the row elements
fSetCustomers = objPTView.FieldSets("Customers")
objPTView.RowAxis.InsertFieldSet(fSetCustomers)
fSetCustomers.Fields("Country").IsIncluded = False
fSetCustomers.Fields("State Province").IsIncluded =
False
fSetCustomers.Fields("Name").IsIncluded = False

' define the members of the row elements
fldCity = fSetCustomers.Fields("City")
fldCity.IncludedMembers = New Object() {strCity1,
strCity2}

' exclude all other field row members in the fieldset
fSetProduct = objPTView.FieldSets("Product")
objPTView.RowAxis.InsertFieldSet(fSetProduct)
fSetProduct.Fields("Product Department").IsIncluded =
False
fSetProduct.Fields("Product Category").IsIncluded =
False
fSetProduct.Fields("Product Subcategory").IsIncluded =
False
fSetProduct.Fields("Brand Name").IsIncluded = False
fSetProduct.Fields("Product Name").IsIncluded = False

'fldProdFamily = fSetProduct.Fields("Product Family")
fldProdFamily.IncludedMembers = "Drink"

' define the measures
objPTView.DataAxis.InsertTotal(objPTView.Totals("Unit
Sales"))
objPTView.DataAxis.InsertTotal(objPTView.Totals("Store
Sales"))
objPTView.DataAxis.Totals("Store Sales").NumberFormat
=
"Currency"

Dim ChartSpace1 As ChartSpaceClass = New
ChartSpaceClass
ChartSpace1.Charts(0).Type() =
ChartChartTypeEnum.chChartTypeBar3D


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
 
A

Alvin Bruney [ASP.NET MVP]

couple things. what is the user account under which the application is being
run? this account needs permissions to automate office. you can use your
desktop setting as a guide to mirror the permissions on the server.

you may also want to consider using the dcom configuration utility to view
permissions for your objects

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_________________________


TJCube said:
Hi Alvin

Thanks for your help so far, I feel that we are getting closer. Today I
have
two more snippets of informaton for you that might help to solve the
problem.

Firstly, I have managed to get Analysis Manager setup on my machine as a
local server. So now the web server and analysis server are all on my
machine
and my machine is .net friendly. I changed the connection to point to the
local AS server and everything worked like a charm. Unfortunately, I have
to
get this working on the production servers (Analysis Manager not web
server)
and as I mentioned earlier, this server has nothing .net related on it at
all.

Secondly, I looked at the exception class in the debugger. Phew what a lot
of stuff. Here are some of the properties that I thought might be useful:

System.Object = {System.Runtime.InteropServices.COMException}
_COMPlusExceptionCode = 0xe0434f4d
_HResult = 0x80004005
_message = "Unspecified error"
Source = "Interop.OWC10"
StackTrace = " at OWC10.PivotView.get_FieldSets()\r\n at
EngenCube.wsEngenOLAP.InitializePivotTableXML(String strCube) in
c:\\inetpub\\wwwroot\\engencube\\services\\wsengenolap.asmx.cs:line 92"

Here is line 92 onwards of my code (Basically, I am looping through all
the
field sets and fields and setting the colours and fonts to the company's
standard look and feel):

for (l_iCountOuter = 0; l_iCountOuter < objView.FieldSets[0].Fields.Count
; l_iCountOuter++)
{
PivotFieldSet l_oFieldSet = objView.FieldSets[l_iCountOuter];
for (l_iCountInner = 0; l_iCountInner < l_oFieldSet.Fields.Count;
l_iCountInner++)
{
PivotField l_oField = l_oFieldSet.Fields[l_iCountInner];
l_oField.GroupedBackColor = c_sSubHeadColor;
l_oField.GroupedFont.Name = "Verdana";
l_oField.GroupedFont.Size = 8;
l_oField.SubtotalBackColor = c_sHeadColor;
l_oField.SubtotalFont.Name = "Verdana";
l_oField.SubtotalFont.Size = 8;
l_oField.SubtotalLabelBackColor = c_sHeadColor;
l_oField.SubtotalLabelFont.Name = "Verdana";
l_oField.SubtotalLabelFont.Size = 8;
l_oField.SubtotalLabelFont.Bold = true;
}
}

Hope this info helps. If you want me to dig deeper into the exception
object, let me know what properties to look for.

Thanks

Alvin Bruney said:
you need to look at the com exception. it contains more detail, post the
exact error message - for instance it may give an hr error code or an
additional string if you search the exception object using the debugger

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_________________________


TJCube said:
Alvin, some more information:

I decided to try to get my code working using client side code to talk
to
the Pivot table object (objPivotTable in my asp page). This following
code
works:

var l_oCube = document.objPivotTable;
var l_oView = l_oCube.ActiveView;
l_oCube.ConnectionString = 'Provider=MSOLAP.2;secured cell
value=3;Persist
Security Info=True;User ID=biwnetadmin;Data Source=CTEIW;Initial
Catalog=ERIC;Client Cache Size=25;Auto Synch Period=10000';
l_oCube.DataMember = "Sales";
l_oView.RowAxis.InsertFieldSet(l_oView.FieldSets("Site"));

but when I create this code as a web service using server side code as
per
one of my earlier posts, it fails.

Curioser and Curiouser, but I need to pull the rabit out of the hat on
this
one ..

:

Yes, I reinstalled OWC 10 on my machine which is the local server in
my
case.
I did not reinstall OWC on the server where the cube is located, cause
its
the production server and I did not want to bring it down during the
day.
Anyway, I am not sure that OWC is neccessary on the server where the
cube
is
located, only on the web server - isnt it?

:

did you re-install?
Hi Alvin

Thanks for the response.

I am communicating with OWC via a web method. The following lines
of
code
work:

string strOLAPConn =
ConfigurationSettings.AppSettings["OLAPConnectionString"];
PivotTableClass objPT = new PivotTableClass();
objPT.ConnectionString = strOLAPConn;
objPT.DataMember = strCube;
PivotView objView = objPT.ActiveView;

and then this line causes the problem:
objView.RowAxis.InsertFieldSet(objView.FieldSets[0],0,true);

My web server is my local machine and I am connecting to a cube on
one of
our production servers. I have reinstalled OWC on my machine (i.e.
the
local
server) and also made ASPNET part of the OLAP Administrators group
on
my
machine. Do I need to do anything to the server containing the
cube
that I
am
connecting to, hopefully not because this server does not have
anythign
.NET
related installed on it.

Another thing when I debug the code and put a watch on the objView
object,
the Fieldset value reads: FieldSets <error: an exception of type:
{System.Runtime.InteropServices.COMException} occurred>
OWC10.PivotFieldSets

This message is also on the Totals property of objView. All other
properties
seem fine and contain values where they should.

Hopefully you have some answer to this chaos.

Thanks


:

we are not here, but leave a message and we will get back to u

This sounds like either a registration issue or a permissions
problem. As
luis said, you need to verify what properties are working. Your
first
step
is to re-install the OWC and then try again.

Hi All

I have just started converting my classic ASP web pages for
office
web
components to .net. I found this wonderful article on the MS
site
entitled
"Build an OLAP Reporting App in ASP.NET using SQL Server 2000
Analysis
Services and Office XP. I have created a project in .Net and
everything
works
fine .. EXCEPT for one thing.

I am getting the following error message "Interop.Owc10 -
Unspecified
error"
when accessing some of the properties and methods of the
OWC10.dll
class.
I
have been searching for a solution on the net and I am hoping
that
this
forum
can help. Below is the sample code for the
LoadCustomPivotTableReport
WebMethod provided with the above article. Everything works
fine
until
the
line starting 'define the column elements'. I am getting the
same
error
if
I
convert the code to c#.

<WebMethod()> 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
Dim fldCity, fldName, fldProdFamily As PivotField
Dim fSetCustomers, fSetProduct As PivotFieldSet

Try
' set the connection string and data member
objPT.ConnectionString = strOLAPConn
objPT.DataMember = "Sales"
'objPT.AllowPropertyToolbox = False
objPT.AllowFiltering = False

objPTView = objPT.ActiveView
objPTView.TitleBar.Caption = "City Comparison of
Drink
Sales"

' define the column elements

objPTView.ColumnAxis.InsertFieldSet(objPTView.FieldSets("Time"))

objPTView.ColumnAxis.FieldSets("Time").Fields("Year").Expanded
=
True

' define the row elements
fSetCustomers = objPTView.FieldSets("Customers")
objPTView.RowAxis.InsertFieldSet(fSetCustomers)
fSetCustomers.Fields("Country").IsIncluded = False
fSetCustomers.Fields("State Province").IsIncluded =
False
fSetCustomers.Fields("Name").IsIncluded = False

' define the members of the row elements
fldCity = fSetCustomers.Fields("City")
fldCity.IncludedMembers = New Object() {strCity1,
strCity2}

' exclude all other field row members in the
fieldset
fSetProduct = objPTView.FieldSets("Product")
objPTView.RowAxis.InsertFieldSet(fSetProduct)
fSetProduct.Fields("Product Department").IsIncluded
=
False
fSetProduct.Fields("Product Category").IsIncluded =
False
fSetProduct.Fields("Product
Subcategory").IsIncluded =
False
fSetProduct.Fields("Brand Name").IsIncluded = False
fSetProduct.Fields("Product Name").IsIncluded =
False

'fldProdFamily = fSetProduct.Fields("Product
Family")
fldProdFamily.IncludedMembers = "Drink"

' define the measures

objPTView.DataAxis.InsertTotal(objPTView.Totals("Unit
Sales"))

objPTView.DataAxis.InsertTotal(objPTView.Totals("Store
Sales"))
objPTView.DataAxis.Totals("Store
Sales").NumberFormat
=
"Currency"

Dim ChartSpace1 As ChartSpaceClass = New
ChartSpaceClass
ChartSpace1.Charts(0).Type() =
ChartChartTypeEnum.chChartTypeBar3D


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
 
T

TJCube

Ok now you are losing me.

I found the Dcom configuration utility, but could find no trace of OWC
components in there. Can you tell me specifically what to look for.

As for the user account question, how do I know which user account I am
running? Is there any message box I can popup to let me know? I have a
feeling that it has got something to do with the ASPNET user.

I have tried various combinations of web server and analysis server:

local web server and local analysis server - works
local web server and dev/test/production analysis server - fails on all 3
dev web server and local analysis server - fails
dev web servera nd dev analysis server - fails

I have installed the .Net framework on the dev analysis server and this also
did not help.

Surely, I am not the only person who has experienced this kind of problem??

I cant spend too much more time troubleshooting this one. Might have to
revert to classic ASP and dump the whole .Net idea.

Very frustrated

Alvin Bruney said:
couple things. what is the user account under which the application is being
run? this account needs permissions to automate office. you can use your
desktop setting as a guide to mirror the permissions on the server.

you may also want to consider using the dcom configuration utility to view
permissions for your objects

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_________________________


TJCube said:
Hi Alvin

Thanks for your help so far, I feel that we are getting closer. Today I
have
two more snippets of informaton for you that might help to solve the
problem.

Firstly, I have managed to get Analysis Manager setup on my machine as a
local server. So now the web server and analysis server are all on my
machine
and my machine is .net friendly. I changed the connection to point to the
local AS server and everything worked like a charm. Unfortunately, I have
to
get this working on the production servers (Analysis Manager not web
server)
and as I mentioned earlier, this server has nothing .net related on it at
all.

Secondly, I looked at the exception class in the debugger. Phew what a lot
of stuff. Here are some of the properties that I thought might be useful:

System.Object = {System.Runtime.InteropServices.COMException}
_COMPlusExceptionCode = 0xe0434f4d
_HResult = 0x80004005
_message = "Unspecified error"
Source = "Interop.OWC10"
StackTrace = " at OWC10.PivotView.get_FieldSets()\r\n at
EngenCube.wsEngenOLAP.InitializePivotTableXML(String strCube) in
c:\\inetpub\\wwwroot\\engencube\\services\\wsengenolap.asmx.cs:line 92"

Here is line 92 onwards of my code (Basically, I am looping through all
the
field sets and fields and setting the colours and fonts to the company's
standard look and feel):

for (l_iCountOuter = 0; l_iCountOuter < objView.FieldSets[0].Fields.Count
; l_iCountOuter++)
{
PivotFieldSet l_oFieldSet = objView.FieldSets[l_iCountOuter];
for (l_iCountInner = 0; l_iCountInner < l_oFieldSet.Fields.Count;
l_iCountInner++)
{
PivotField l_oField = l_oFieldSet.Fields[l_iCountInner];
l_oField.GroupedBackColor = c_sSubHeadColor;
l_oField.GroupedFont.Name = "Verdana";
l_oField.GroupedFont.Size = 8;
l_oField.SubtotalBackColor = c_sHeadColor;
l_oField.SubtotalFont.Name = "Verdana";
l_oField.SubtotalFont.Size = 8;
l_oField.SubtotalLabelBackColor = c_sHeadColor;
l_oField.SubtotalLabelFont.Name = "Verdana";
l_oField.SubtotalLabelFont.Size = 8;
l_oField.SubtotalLabelFont.Bold = true;
}
}

Hope this info helps. If you want me to dig deeper into the exception
object, let me know what properties to look for.

Thanks

Alvin Bruney said:
you need to look at the com exception. it contains more detail, post the
exact error message - for instance it may give an hr error code or an
additional string if you search the exception object using the debugger

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_________________________


Alvin, some more information:

I decided to try to get my code working using client side code to talk
to
the Pivot table object (objPivotTable in my asp page). This following
code
works:

var l_oCube = document.objPivotTable;
var l_oView = l_oCube.ActiveView;
l_oCube.ConnectionString = 'Provider=MSOLAP.2;secured cell
value=3;Persist
Security Info=True;User ID=biwnetadmin;Data Source=CTEIW;Initial
Catalog=ERIC;Client Cache Size=25;Auto Synch Period=10000';
l_oCube.DataMember = "Sales";
l_oView.RowAxis.InsertFieldSet(l_oView.FieldSets("Site"));

but when I create this code as a web service using server side code as
per
one of my earlier posts, it fails.

Curioser and Curiouser, but I need to pull the rabit out of the hat on
this
one ..

:

Yes, I reinstalled OWC 10 on my machine which is the local server in
my
case.
I did not reinstall OWC on the server where the cube is located, cause
its
the production server and I did not want to bring it down during the
day.
Anyway, I am not sure that OWC is neccessary on the server where the
cube
is
located, only on the web server - isnt it?

:

did you re-install?
Hi Alvin

Thanks for the response.

I am communicating with OWC via a web method. The following lines
of
code
work:

string strOLAPConn =
ConfigurationSettings.AppSettings["OLAPConnectionString"];
PivotTableClass objPT = new PivotTableClass();
objPT.ConnectionString = strOLAPConn;
objPT.DataMember = strCube;
PivotView objView = objPT.ActiveView;

and then this line causes the problem:
objView.RowAxis.InsertFieldSet(objView.FieldSets[0],0,true);

My web server is my local machine and I am connecting to a cube on
one of
our production servers. I have reinstalled OWC on my machine (i.e.
the
local
server) and also made ASPNET part of the OLAP Administrators group
on
my
machine. Do I need to do anything to the server containing the
cube
that I
am
connecting to, hopefully not because this server does not have
anythign
.NET
related installed on it.

Another thing when I debug the code and put a watch on the objView
object,
the Fieldset value reads: FieldSets <error: an exception of type:
{System.Runtime.InteropServices.COMException} occurred>
OWC10.PivotFieldSets

This message is also on the Totals property of objView. All other
properties
seem fine and contain values where they should.

Hopefully you have some answer to this chaos.

Thanks


:

we are not here, but leave a message and we will get back to u

This sounds like either a registration issue or a permissions
problem. As
luis said, you need to verify what properties are working. Your
first
step
is to re-install the OWC and then try again.

Hi All

I have just started converting my classic ASP web pages for
office
web
components to .net. I found this wonderful article on the MS
site
entitled
"Build an OLAP Reporting App in ASP.NET using SQL Server 2000
Analysis
Services and Office XP. I have created a project in .Net and
everything
works
fine .. EXCEPT for one thing.

I am getting the following error message "Interop.Owc10 -
Unspecified
error"
when accessing some of the properties and methods of the
OWC10.dll
class.
I
have been searching for a solution on the net and I am hoping
that
this
forum
can help. Below is the sample code for the
LoadCustomPivotTableReport
WebMethod provided with the above article. Everything works
fine
until
the
line starting 'define the column elements'. I am getting the
same
error
if
I
convert the code to c#.

<WebMethod()> 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
Dim fldCity, fldName, fldProdFamily As PivotField
Dim fSetCustomers, fSetProduct As PivotFieldSet

Try
' set the connection string and data member
objPT.ConnectionString = strOLAPConn
objPT.DataMember = "Sales"
'objPT.AllowPropertyToolbox = False
objPT.AllowFiltering = False

objPTView = objPT.ActiveView
objPTView.TitleBar.Caption = "City Comparison of
Drink
Sales"

' define the column elements

objPTView.ColumnAxis.InsertFieldSet(objPTView.FieldSets("Time"))

objPTView.ColumnAxis.FieldSets("Time").Fields("Year").Expanded
=
True

' define the row elements
fSetCustomers = objPTView.FieldSets("Customers")
objPTView.RowAxis.InsertFieldSet(fSetCustomers)
fSetCustomers.Fields("Country").IsIncluded = False
fSetCustomers.Fields("State Province").IsIncluded =
False
fSetCustomers.Fields("Name").IsIncluded = False

' define the members of the row elements
fldCity = fSetCustomers.Fields("City")
fldCity.IncludedMembers = New Object() {strCity1,
strCity2}

' exclude all other field row members in the
fieldset
fSetProduct = objPTView.FieldSets("Product")
objPTView.RowAxis.InsertFieldSet(fSetProduct)
fSetProduct.Fields("Product Department").IsIncluded
=
False
fSetProduct.Fields("Product Category").IsIncluded =
False
fSetProduct.Fields("Product
Subcategory").IsIncluded =
False
fSetProduct.Fields("Brand Name").IsIncluded = False
fSetProduct.Fields("Product Name").IsIncluded =
False

'fldProdFamily = fSetProduct.Fields("Product
Family")
fldProdFamily.IncludedMembers = "Drink"

' define the measures

objPTView.DataAxis.InsertTotal(objPTView.Totals("Unit
Sales"))

objPTView.DataAxis.InsertTotal(objPTView.Totals("Store
Sales"))
objPTView.DataAxis.Totals("Store
Sales").NumberFormat
=
"Currency"

Dim ChartSpace1 As ChartSpaceClass = New
ChartSpaceClass
ChartSpace1.Charts(0).Type() =
ChartChartTypeEnum.chChartTypeBar3D


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
 
A

Alvin Bruney [ASP.NET MVP]

See my earlier response to your co-workers request. It should solve your
problem.

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_________________________


TJCube said:
Ok now you are losing me.

I found the Dcom configuration utility, but could find no trace of OWC
components in there. Can you tell me specifically what to look for.

As for the user account question, how do I know which user account I am
running? Is there any message box I can popup to let me know? I have a
feeling that it has got something to do with the ASPNET user.

I have tried various combinations of web server and analysis server:

local web server and local analysis server - works
local web server and dev/test/production analysis server - fails on all 3
dev web server and local analysis server - fails
dev web servera nd dev analysis server - fails

I have installed the .Net framework on the dev analysis server and this
also
did not help.

Surely, I am not the only person who has experienced this kind of
problem??

I cant spend too much more time troubleshooting this one. Might have to
revert to classic ASP and dump the whole .Net idea.

Very frustrated

Alvin Bruney said:
couple things. what is the user account under which the application is
being
run? this account needs permissions to automate office. you can use your
desktop setting as a guide to mirror the permissions on the server.

you may also want to consider using the dcom configuration utility to
view
permissions for your objects

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_________________________


TJCube said:
Hi Alvin

Thanks for your help so far, I feel that we are getting closer. Today I
have
two more snippets of informaton for you that might help to solve the
problem.

Firstly, I have managed to get Analysis Manager setup on my machine as
a
local server. So now the web server and analysis server are all on my
machine
and my machine is .net friendly. I changed the connection to point to
the
local AS server and everything worked like a charm. Unfortunately, I
have
to
get this working on the production servers (Analysis Manager not web
server)
and as I mentioned earlier, this server has nothing .net related on it
at
all.

Secondly, I looked at the exception class in the debugger. Phew what a
lot
of stuff. Here are some of the properties that I thought might be
useful:

System.Object = {System.Runtime.InteropServices.COMException}
_COMPlusExceptionCode = 0xe0434f4d
_HResult = 0x80004005
_message = "Unspecified error"
Source = "Interop.OWC10"
StackTrace = " at OWC10.PivotView.get_FieldSets()\r\n at
EngenCube.wsEngenOLAP.InitializePivotTableXML(String strCube) in
c:\\inetpub\\wwwroot\\engencube\\services\\wsengenolap.asmx.cs:line 92"

Here is line 92 onwards of my code (Basically, I am looping through all
the
field sets and fields and setting the colours and fonts to the
company's
standard look and feel):

for (l_iCountOuter = 0; l_iCountOuter <
objView.FieldSets[0].Fields.Count
; l_iCountOuter++)
{
PivotFieldSet l_oFieldSet = objView.FieldSets[l_iCountOuter];
for (l_iCountInner = 0; l_iCountInner < l_oFieldSet.Fields.Count;
l_iCountInner++)
{
PivotField l_oField = l_oFieldSet.Fields[l_iCountInner];
l_oField.GroupedBackColor = c_sSubHeadColor;
l_oField.GroupedFont.Name = "Verdana";
l_oField.GroupedFont.Size = 8;
l_oField.SubtotalBackColor = c_sHeadColor;
l_oField.SubtotalFont.Name = "Verdana";
l_oField.SubtotalFont.Size = 8;
l_oField.SubtotalLabelBackColor = c_sHeadColor;
l_oField.SubtotalLabelFont.Name = "Verdana";
l_oField.SubtotalLabelFont.Size = 8;
l_oField.SubtotalLabelFont.Bold = true;
}
}

Hope this info helps. If you want me to dig deeper into the exception
object, let me know what properties to look for.

Thanks

:

you need to look at the com exception. it contains more detail, post
the
exact error message - for instance it may give an hr error code or an
additional string if you search the exception object using the
debugger

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_________________________


Alvin, some more information:

I decided to try to get my code working using client side code to
talk
to
the Pivot table object (objPivotTable in my asp page). This
following
code
works:

var l_oCube = document.objPivotTable;
var l_oView = l_oCube.ActiveView;
l_oCube.ConnectionString = 'Provider=MSOLAP.2;secured cell
value=3;Persist
Security Info=True;User ID=biwnetadmin;Data Source=CTEIW;Initial
Catalog=ERIC;Client Cache Size=25;Auto Synch Period=10000';
l_oCube.DataMember = "Sales";
l_oView.RowAxis.InsertFieldSet(l_oView.FieldSets("Site"));

but when I create this code as a web service using server side code
as
per
one of my earlier posts, it fails.

Curioser and Curiouser, but I need to pull the rabit out of the hat
on
this
one ..

:

Yes, I reinstalled OWC 10 on my machine which is the local server
in
my
case.
I did not reinstall OWC on the server where the cube is located,
cause
its
the production server and I did not want to bring it down during
the
day.
Anyway, I am not sure that OWC is neccessary on the server where
the
cube
is
located, only on the web server - isnt it?

:

did you re-install?
Hi Alvin

Thanks for the response.

I am communicating with OWC via a web method. The following
lines
of
code
work:

string strOLAPConn =
ConfigurationSettings.AppSettings["OLAPConnectionString"];
PivotTableClass objPT = new PivotTableClass();
objPT.ConnectionString = strOLAPConn;
objPT.DataMember = strCube;
PivotView objView = objPT.ActiveView;

and then this line causes the problem:
objView.RowAxis.InsertFieldSet(objView.FieldSets[0],0,true);

My web server is my local machine and I am connecting to a cube
on
one of
our production servers. I have reinstalled OWC on my machine
(i.e.
the
local
server) and also made ASPNET part of the OLAP Administrators
group
on
my
machine. Do I need to do anything to the server containing the
cube
that I
am
connecting to, hopefully not because this server does not have
anythign
.NET
related installed on it.

Another thing when I debug the code and put a watch on the
objView
object,
the Fieldset value reads: FieldSets <error: an exception of
type:
{System.Runtime.InteropServices.COMException} occurred>
OWC10.PivotFieldSets

This message is also on the Totals property of objView. All
other
properties
seem fine and contain values where they should.

Hopefully you have some answer to this chaos.

Thanks


:

we are not here, but leave a message and we will get back to u

This sounds like either a registration issue or a permissions
problem. As
luis said, you need to verify what properties are working.
Your
first
step
is to re-install the OWC and then try again.

Hi All

I have just started converting my classic ASP web pages for
office
web
components to .net. I found this wonderful article on the MS
site
entitled
"Build an OLAP Reporting App in ASP.NET using SQL Server
2000
Analysis
Services and Office XP. I have created a project in .Net and
everything
works
fine .. EXCEPT for one thing.

I am getting the following error message "Interop.Owc10 -
Unspecified
error"
when accessing some of the properties and methods of the
OWC10.dll
class.
I
have been searching for a solution on the net and I am
hoping
that
this
forum
can help. Below is the sample code for the
LoadCustomPivotTableReport
WebMethod provided with the above article. Everything works
fine
until
the
line starting 'define the column elements'. I am getting the
same
error
if
I
convert the code to c#.

<WebMethod()> 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
Dim fldCity, fldName, fldProdFamily As PivotField
Dim fSetCustomers, fSetProduct As PivotFieldSet

Try
' set the connection string and data member
objPT.ConnectionString = strOLAPConn
objPT.DataMember = "Sales"
'objPT.AllowPropertyToolbox = False
objPT.AllowFiltering = False

objPTView = objPT.ActiveView
objPTView.TitleBar.Caption = "City Comparison of
Drink
Sales"

' define the column elements

objPTView.ColumnAxis.InsertFieldSet(objPTView.FieldSets("Time"))

objPTView.ColumnAxis.FieldSets("Time").Fields("Year").Expanded
=
True

' define the row elements
fSetCustomers = objPTView.FieldSets("Customers")
objPTView.RowAxis.InsertFieldSet(fSetCustomers)
fSetCustomers.Fields("Country").IsIncluded =
False
fSetCustomers.Fields("State
Province").IsIncluded =
False
fSetCustomers.Fields("Name").IsIncluded = False

' define the members of the row elements
fldCity = fSetCustomers.Fields("City")
fldCity.IncludedMembers = New Object()
{strCity1,
strCity2}

' exclude all other field row members in the
fieldset
fSetProduct = objPTView.FieldSets("Product")
objPTView.RowAxis.InsertFieldSet(fSetProduct)
fSetProduct.Fields("Product
Department").IsIncluded
=
False
fSetProduct.Fields("Product
Category").IsIncluded =
False
fSetProduct.Fields("Product
Subcategory").IsIncluded =
False
fSetProduct.Fields("Brand Name").IsIncluded =
False
fSetProduct.Fields("Product Name").IsIncluded =
False

'fldProdFamily = fSetProduct.Fields("Product
Family")
fldProdFamily.IncludedMembers = "Drink"

' define the measures

objPTView.DataAxis.InsertTotal(objPTView.Totals("Unit
Sales"))

objPTView.DataAxis.InsertTotal(objPTView.Totals("Store
Sales"))
objPTView.DataAxis.Totals("Store
Sales").NumberFormat
=
"Currency"

Dim ChartSpace1 As ChartSpaceClass = New
ChartSpaceClass
ChartSpace1.Charts(0).Type() =
ChartChartTypeEnum.chChartTypeBar3D


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
 
M

mcclurgprudence6349

Alvin, some more information:
I decided to try to get my code working using client side code to talk to
the Pivot table object (objPivotTable in my asp page). This following code
works:
var l_oCube = document.objPivotTable;
var l_oView = l_oCube.ActiveView;
l_oCube.ConnectionString = 'Provider=MSOLAP.2;secured cell value=3;Persist
Security Info=True;User ID=biwnetadmin;Data Source=CTEIW;Initial
Catalog=ERIC;Client Cache Size=25;Auto Synch Period=10000';
l_oCube.DataMember = "Sales";
l_oView.RowAxis.InsertFieldSet(l_oView.FieldSets("Site"));
but when I create this code as a web service using server side code as per
one of my earlier posts, it fails.
Curioser and Curiouser, but I need to pull the rabit out of the hat on this
one ..
"TJCube" wrote:

Great

(e-mail address removed)
 

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