Excel Web Components and SQL Server OLAP

Excel Web Components and SQL Server OLAP

Post by Aaron Ruhno » Sat, 22 Sep 2001 03:37:40



I apologize in advance for the simplicity of this problem.
I am working with a group that needs to put together a
quick demonstration showing SQLServer's OLAP capabilities
(and I have very little experience with this technology).

I am looking into using Excel (via the web) and the Pivot
tables/OLAP cubes. I found a sample on MSDN that uses the
FoodMart 2000 database which includes an Active Server
Page that has an excel Web Component. When the component
attempts to set the CommandText of the Web Component (via
client-side VBScript), the error message "Requested
interface is not supported" appears.  I don't know what
this means, and could not find specific infor on MSDN
about it.

I also get a message about accessing data on another
domain. I attempted to add the site to the trusted sites
setting on IE options, but I still get the message. Don't
know if this is related to the problem in any way. I don't
think it is.

I am running Win2K Professional with SQLServer 2000
(including Analysis Services), and office 2000. Web server
is also on the same machine (localhost)

ASP source is beliw (its pretty straight-forward). The
line with the error is marked.

<HTML>
<HEAD><meta name="Example 1" contents= "NOINDEX, NOFOLLOW">
<TITLE>OLAP Number Formats UseProviderFormatting
Sample</TITLE>
<META NAME="GENERATOR" Content="Microsoft Visual Studio">
<META HTTP-EQUIV="Content-Type" content="text/html;
charset=UTF-8">
</HEAD>
<BODY bgcolor=lightskyblue text="#000000" link="#006600"
vlink="#669966" alink="#990000">
Server Name  : <input id=ServerName style="width:70%"
value="localhost"></input><br>
Database Name: <input id=Catalog style="width:70%"
value="Foodmart 2000"></input><br>
Cube Name    : <input id=Cube style="width:70%"
value="Sales"></input><p>
<button ONCLICK=Connect_OnClick()
ID=Button1>Connect</button><p>
<OBJECT CLASSID="clsid:0002E520-0000-0000-C000-
000000000046" id="MyPT" VIEWASTEXT>
</OBJECT>

<script language=VBScript>

function Connect_OnClick()
        MyPT.ConnectionString = "Provider=MSOLAP.2;Data
Source=" & ServerName.Value & ";Initial Catalog=" &
Catalog.value
        MyPT.DataMember = Cube.value

        ' Put measures on the view.
        MyPT.CommandText =      "select
AddCalculatedMembers(Measures.members)  " & _
                        "on columns"      & _
                        "from [" & Cube.value & "]"
        ' Set the UseProviderFormatting property to TRUE.
        ' This will result in measures being displayed as
left justified text.
        MyPT.ActiveView.UseProviderFormatting=true
end function
</script>

</BODY>
</HTML>

Thanks.

 
 
 

Excel Web Components and SQL Server OLAP

Post by Walter Biff » Sat, 22 Sep 2001 04:35:11


Aaron,

The Error you are getting is due to the fact that the PivotTable control
that ships with Office 2000 does not allow to pass mdx statement to the
CommandText property.

I modified the content of the OnClick function like so:

MyPT.ConnectionString = "Provider=MSOLAP.2;Data Source=" & ServerName.Value
& ";Initial Catalog=" & Catalog.value
MyPT.DataMember = Cube.value
MyPT.DisplayFieldList = True

Well I removed what was causing the error and added the line
  MyPT.DisplayFieldList = True
so that you can drag and drop dimensions and measures into the
PivotTable control.

You could programmatically default a view but I did not
want to get into all that.

Regards,

--
Walter Biffi
MS Analysis Services Consultant


Quote:

> I apologize in advance for the simplicity of this problem.
> I am working with a group that needs to put together a
> quick demonstration showing SQLServer's OLAP capabilities
> (and I have very little experience with this technology).

> I am looking into using Excel (via the web) and the Pivot
> tables/OLAP cubes. I found a sample on MSDN that uses the
> FoodMart 2000 database which includes an Active Server
> Page that has an excel Web Component. When the component
> attempts to set the CommandText of the Web Component (via
> client-side VBScript), the error message "Requested
> interface is not supported" appears.  I don't know what
> this means, and could not find specific infor on MSDN
> about it.

> I also get a message about accessing data on another
> domain. I attempted to add the site to the trusted sites
> setting on IE options, but I still get the message. Don't
> know if this is related to the problem in any way. I don't
> think it is.

> I am running Win2K Professional with SQLServer 2000
> (including Analysis Services), and office 2000. Web server
> is also on the same machine (localhost)

> ASP source is beliw (its pretty straight-forward). The
> line with the error is marked.

> <HTML>
> <HEAD><meta name="Example 1" contents= "NOINDEX, NOFOLLOW">
> <TITLE>OLAP Number Formats UseProviderFormatting
> Sample</TITLE>
> <META NAME="GENERATOR" Content="Microsoft Visual Studio">
> <META HTTP-EQUIV="Content-Type" content="text/html;
> charset=UTF-8">
> </HEAD>
> <BODY bgcolor=lightskyblue text="#000000" link="#006600"
> vlink="#669966" alink="#990000">
> Server Name  : <input id=ServerName style="width:70%"
> value="localhost"></input><br>
> Database Name: <input id=Catalog style="width:70%"
> value="Foodmart 2000"></input><br>
> Cube Name    : <input id=Cube style="width:70%"
> value="Sales"></input><p>
> <button ONCLICK=Connect_OnClick()
> ID=Button1>Connect</button><p>
> <OBJECT CLASSID="clsid:0002E520-0000-0000-C000-
> 000000000046" id="MyPT" VIEWASTEXT>
> </OBJECT>

> <script language=VBScript>

> function Connect_OnClick()
> MyPT.ConnectionString = "Provider=MSOLAP.2;Data
> Source=" & ServerName.Value & ";Initial Catalog=" &
> Catalog.value
> MyPT.DataMember = Cube.value

> ' Put measures on the view.
> MyPT.CommandText = "select
> AddCalculatedMembers(Measures.members) " & _
> "on columns"      & _
> "from [" & Cube.value & "]"
>         ' Set the UseProviderFormatting property to TRUE.
>         ' This will result in measures being displayed as
> left justified text.
> MyPT.ActiveView.UseProviderFormatting=true
> end function
> </script>

> </BODY>
> </HTML>

> Thanks.


 
 
 

Excel Web Components and SQL Server OLAP

Post by Aaron Ruhno » Sat, 22 Sep 2001 04:52:26


Perfect! Thanks for the help...

>-----Original Message-----
>Aaron,

>The Error you are getting is due to the fact that the
PivotTable control
>that ships with Office 2000 does not allow to pass mdx
statement to the
>CommandText property.

>I modified the content of the OnClick function like so:

>MyPT.ConnectionString = "Provider=MSOLAP.2;Data Source="
& ServerName.Value
>& ";Initial Catalog=" & Catalog.value
>MyPT.DataMember = Cube.value
>MyPT.DisplayFieldList = True

>Well I removed what was causing the error and added the
line
>  MyPT.DisplayFieldList = True
>so that you can drag and drop dimensions and measures
into the
>PivotTable control.

>You could programmatically default a view but I did not
>want to get into all that.

>Regards,

>--
>Walter Biffi
>MS Analysis Services Consultant



>> I apologize in advance for the simplicity of this
problem.
>> I am working with a group that needs to put together a
>> quick demonstration showing SQLServer's OLAP
capabilities
>> (and I have very little experience with this
technology).

>> I am looking into using Excel (via the web) and the
Pivot
>> tables/OLAP cubes. I found a sample on MSDN that uses
the
>> FoodMart 2000 database which includes an Active Server
>> Page that has an excel Web Component. When the component
>> attempts to set the CommandText of the Web Component
(via
>> client-side VBScript), the error message "Requested
>> interface is not supported" appears.  I don't know what
>> this means, and could not find specific infor on MSDN
>> about it.

>> I also get a message about accessing data on another
>> domain. I attempted to add the site to the trusted sites
>> setting on IE options, but I still get the message.
Don't
>> know if this is related to the problem in any way. I
don't
>> think it is.

>> I am running Win2K Professional with SQLServer 2000
>> (including Analysis Services), and office 2000. Web
server
>> is also on the same machine (localhost)

>> ASP source is beliw (its pretty straight-forward). The
>> line with the error is marked.

>> <HTML>
>> <HEAD><meta name="Example 1" contents= "NOINDEX,
NOFOLLOW">
>> <TITLE>OLAP Number Formats UseProviderFormatting
>> Sample</TITLE>
>> <META NAME="GENERATOR" Content="Microsoft Visual
Studio">
>> <META HTTP-EQUIV="Content-Type" content="text/html;
>> charset=UTF-8">
>> </HEAD>
>> <BODY bgcolor=lightskyblue text="#000000" link="#006600"
>> vlink="#669966" alink="#990000">
>> Server Name  : <input id=ServerName style="width:70%"
>> value="localhost"></input><br>
>> Database Name: <input id=Catalog style="width:70%"
>> value="Foodmart 2000"></input><br>
>> Cube Name    : <input id=Cube style="width:70%"
>> value="Sales"></input><p>
>> <button ONCLICK=Connect_OnClick()
>> ID=Button1>Connect</button><p>
>> <OBJECT CLASSID="clsid:0002E520-0000-0000-C000-
>> 000000000046" id="MyPT" VIEWASTEXT>
>> </OBJECT>

>> <script language=VBScript>

>> function Connect_OnClick()
>> MyPT.ConnectionString = "Provider=MSOLAP.2;Data
>> Source=" & ServerName.Value & ";Initial Catalog=" &
>> Catalog.value
>> MyPT.DataMember = Cube.value

>> ' Put measures on the view.
>> MyPT.CommandText = "select
>> AddCalculatedMembers(Measures.members) " & _
>> "on columns"      & _
>> "from [" & Cube.value & "]"
>>         ' Set the UseProviderFormatting property to
TRUE.
>>         ' This will result in measures being displayed
as
>> left justified text.
>> MyPT.ActiveView.UseProviderFormatting=true
>> end function
>> </script>

>> </BODY>
>> </HTML>

>> Thanks.

>.