D
Douglas Osborne
I have the code below, which runs, however I do not have an active view
after I load the command text with the name of the xml file.
What command might I be missing?
TIA,
Doug
public OWC11.PivotTable pt2;
public OWC11.PivotView pv2;
public OWC11.PivotFieldSets ps2;
private void Page_Load(object sender, System.EventArgs e)
{
try
{
// Create a new PivotTable
pt2 = new OWC11.PivotTableClass();
// Not sure
pt2.AutoFit = true;
// Set data to load
pt2.CommandText = "C:\\APPLICATIONS\\ExcelPivot\\PatientSummary.xml";
// Problem is here - no active view - what else needs to be set?
pv2 = pt2.ActiveView;
// Clear the labels
pv2.FilterAxis.Label.Visible = false;
pv2.RowAxis.Label.Visible = false;
pv2.ColumnAxis.Label.Visible = false;
pv2.TitleBar.Visible = false;
// Get variables from the pivot table
pv2 = pt2.ActiveView;
ps2 = pt2.ActiveView.FieldSets;
// Add Category to the Row axis
pv2.RowAxis.InsertFieldSet ps2["PracticeName"];
}
catch( Exception Ex )
{
string Error = Ex.Message;
}
}
after I load the command text with the name of the xml file.
What command might I be missing?
TIA,
Doug
public OWC11.PivotTable pt2;
public OWC11.PivotView pv2;
public OWC11.PivotFieldSets ps2;
private void Page_Load(object sender, System.EventArgs e)
{
try
{
// Create a new PivotTable
pt2 = new OWC11.PivotTableClass();
// Not sure
pt2.AutoFit = true;
// Set data to load
pt2.CommandText = "C:\\APPLICATIONS\\ExcelPivot\\PatientSummary.xml";
// Problem is here - no active view - what else needs to be set?
pv2 = pt2.ActiveView;
// Clear the labels
pv2.FilterAxis.Label.Visible = false;
pv2.RowAxis.Label.Visible = false;
pv2.ColumnAxis.Label.Visible = false;
pv2.TitleBar.Visible = false;
// Get variables from the pivot table
pv2 = pt2.ActiveView;
ps2 = pt2.ActiveView.FieldSets;
// Add Category to the Row axis
pv2.RowAxis.InsertFieldSet ps2["PracticeName"];
}
catch( Exception Ex )
{
string Error = Ex.Message;
}
}