PivotTableWizard Using Csharp

A

Arghad Arnaout

Hi,
I am trying to create a PivotTable which has an OLAP as a data source, but I
didn't survive with this.
Here is my try:
string path = @"c:\Book1.xls";
string connectionStr = "Provider=MSOLAP.3;Cache
Authentication=False;Integrated Security=SSPI;Persist Security Info=True;Data
Source=NB_AA;Impersonation Level=Impersonate;Mode=ReadWrite;Protection
Level=Pkt Privacy;Auto Synch Period=20000;Default Isolation Mode=0;Default
MDX Visual Mode=0;MDX Compatibility=0;MDX Unique Name Style=0;Non Empty
Threshold=0;SQLQueryMode=Calculated;Safety Options=1;Secured Cell Value=0;SQL
Compatibility=0;Compression Level=0;Real Time Olap=False;Packet
Size=4096;Initial Catalog=OLAPDB";
excel = new Microsoft.Office.Interop.Excel.ApplicationClass();
workBook =
(ExcelInterop.WorkbookClass)excel.Workbooks.Open(path, 0, true, 5, "", "",
true, ExcelInterop.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
sheets = workBook.Worksheets;
worksheet = (ExcelInterop.Worksheet)sheets.get_Item(1);
ExcelInterop.Range range = worksheet.get_Range("A1", "X300");
ExcelInterop.PivotTable table =
worksheet.PivotTableWizard(ExcelInterop.XlPivotTableSourceType.xlDatabase,
null, range, "PivotTable1", false, false, true, false, null, null, false,
false, ExcelInterop.XlOrder.xlDownThenOver, null, null, connectionStr);

Any help?

thank you in advance ....
regards,
Arghad Arnaout
 
A

Arghad Arnaout

Or maybe somebody knows how to use the method:

Microsoft.Office.Interop.Excel.WorksheetClass.PivotTableWizard();

thank you.

Arghad
 

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