Hi Sir,
I downloaded your sample: PivotTableReport.aspx & PivotTableReport.aspx.vb.
I am exploring methods to export data from database into pivot table.
However when I try to run your sample code I hit the following error when I click on the link - "Export To Excel"
I get the following error:
Microsoft JScript runtine error: 'Worksheet(...).PivotTables(...).PivotFields(...).Interior' is null or not an object at the following lines -
WorkBook.Worksheets(2).PivotTables("PivotTable1").PivotFields("Name").Interior.ColorIndex = 10;
WorkBook.Worksheets(1).PivotTables("PivotTable1").PivotFields("Age").Function = -4112;
WorkBook.Worksheets(2).PivotTables("PivotTable1").DisplayImmediateItems = true;
var ch1 = Sheet2.ChartObjects.Add(rang2.Left + rang2.Width, rang2.Top, 350, 220);
ch1.Chart.ChartType = -4120;
ch1.Chart.SetSourceData(rang2, 2);
var ch1 = Sheet2.ChartObjects.Add(ch1.Left + ch1.Width, ch1.Top, 400, 250);
ch1.Chart.ChartType = 95;
ch1.Chart.SetSourceData(rang2, 2);
var ch2 = Sheet2.ChartObjects.Add(rang2.Left + rang2.Width, ch1.Top + ch1.Height, 400, 250);
ch2.Chart.ChartType = -4100;
ch2.Chart.SetSourceData(rang2, 2);
WorkBook.Worksheets(2).Name = "Pivot_Table_Report";
WorkBook.Worksheets(1).Delete();
WorkBook.Worksheets(2).Delete();
WorkBook.HTMLProject.RefreshDocument();
ExlApp.UserControl = false;
ExlApp.Visible = true;
}
Please assist me with the following. Your help is most apperiated!