Hi,
We are using Syncfusion XlsIO for reporting purposes.
I am working on a report which is based on a template.
The template contains a pivot table.
Using Syncfusion XlsIO I fill the datasource of the pivot table with new data.
The pivot table requires a filter on the column values. The filter is on a date field and is dynamic (the user specifies it upon report creation).
I cannot find out how to achieve this using XlsIO.
Let's sat the date column contains the following values:
1-3-2016
1-5-2016
1-7-2016
1-9-2016
1-11-2016
And I need "1-5-2016" and "1-11-2016" as the column values.
I can access the Items collection of the pivot table field and set the visibility like so:
IPivotTable pivtable = this.Sheet.PivotTables["PivotTable6"];
IPivotField pivfield = pivtable.Fields["Date"];
pivfield.Items[0].Visible = false;
pivfield.Items[1].Visible = true;
etc.
however I cannot access the Text property of the PivotFieldItem because the IPivotTableFIeld interface only exposes the Visible property and I cannot cast to PivotFieldItem because the class is not exposed.
So how do I determine dynamically which items I need to set to visible?
I would need access to the Text property so I can determine if I need to set Visible to true or false.
Any help would be appreciated,
thanks
Peter