"Owc11.PivotTable" with C# and ASP.NET does not show up

S

Siegmar

Hi,

The following code does work fine in the Page_Load event of an ASP.NET page:

Response.Write(@"<OBJECT
id='pivotTable'
style='Z-INDEX: 0; POSITION: absolute; TOP: 0px; LEFT: 0px; HEIGHT: 600px;
WIDTH:800px;'
height='600'
width='800'
classid='clsid:0002E55A-0000-0000-C000-000000000046'>
</OBJECT>
<script>
document.all.pivotTable.ConnectionString='Provider=MSOLAP;Integrated
Security=SSPI;Persist Security Info=False;Initial Catalog=SSAS;Data
Source=localhost;Initial Catalog=SSAS'
document.all.pivotTable.DataMember='Adventure Works DW2008'
document.all.pivotTable.DisplayFieldList = true
</script>");
Response.End();

But when I use "Microsoft.Office.Interop.Owc11.PivotTable" just a blue
toolbar shows up:

Microsoft.Office.Interop.Owc11.PivotTable pivotTable = new
Microsoft.Office.Interop.Owc11.PivotTable();

pivotTable.ConnectionString = "Provider=MSOLAP;Integrated
Security=SSPI;Persist Security Info=False;Initial Catalog=SSAS;Data
Source=(local);Initial Catalog=SSAS";
pivotTable.DataMember = "Adventure Works DW2008";
//pivotTable.DisplayAlerts = true;
//pivotTable.DisplayDesignTimeUI = true;
//pivotTable.DisplayExpandIndicator = true;
pivotTable.DisplayFieldList = true;
//pivotTable.DisplayOfficeLogo = true;
//pivotTable.DisplayPropertyToolbox = true;
//pivotTable.DisplayScreenTips = true;
pivotTable.DisplayToolbar = true;

Response.Write(pivotTable.HTMLData);

What is the problem? Im i forgetting something?

Thanks
 
A

Alvin Bruney [ASP.NET MVP]

Are you sure you are getting data back from the query?

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
 
S

Siegmar

Hi,

It´s a nice question!

When I use "Response.Write" it does work with "localhost" or "(local)" and I
see the Field List and the Cube.
When I use "pivotTable" object it does not work, but the "ConnectionStrings"
are the same.

Is there any kind of "Connection.Open" I should use with "pivotTable"?
Is there any Security issue related to "pivotTable", different from
"Response.Write"?

Thanks,

Siegmar Gieseler

Alvin Bruney said:
Are you sure you are getting data back from the query?

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------




Siegmar said:
Hi,

The following code does work fine in the Page_Load event of an ASP.NET
page:

Response.Write(@"<OBJECT
id='pivotTable'
style='Z-INDEX: 0; POSITION: absolute; TOP: 0px; LEFT: 0px; HEIGHT: 600px;
WIDTH:800px;'
height='600'
width='800'
classid='clsid:0002E55A-0000-0000-C000-000000000046'>
</OBJECT>
<script>
document.all.pivotTable.ConnectionString='Provider=MSOLAP;Integrated
Security=SSPI;Persist Security Info=False;Initial Catalog=SSAS;Data
Source=localhost;Initial Catalog=SSAS'
document.all.pivotTable.DataMember='Adventure Works DW2008'
document.all.pivotTable.DisplayFieldList = true
</script>");
Response.End();

But when I use "Microsoft.Office.Interop.Owc11.PivotTable" just a blue
toolbar shows up:

Microsoft.Office.Interop.Owc11.PivotTable pivotTable = new
Microsoft.Office.Interop.Owc11.PivotTable();

pivotTable.ConnectionString = "Provider=MSOLAP;Integrated
Security=SSPI;Persist Security Info=False;Initial Catalog=SSAS;Data
Source=(local);Initial Catalog=SSAS";
pivotTable.DataMember = "Adventure Works DW2008";
//pivotTable.DisplayAlerts = true;
//pivotTable.DisplayDesignTimeUI = true;
//pivotTable.DisplayExpandIndicator = true;
pivotTable.DisplayFieldList = true;
//pivotTable.DisplayOfficeLogo = true;
//pivotTable.DisplayPropertyToolbox = true;
//pivotTable.DisplayScreenTips = true;
pivotTable.DisplayToolbar = true;

Response.Write(pivotTable.HTMLData);

What is the problem? Im i forgetting something?

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