0

How do you set default Report Filter value?

 Dim ws_pivot As IXLWorksheet = wb.Worksheets.Add("NAME")
 Dim pivot_range As IXLRange = some_data.RangeUsed()
 Dim pivot_table As IXLPivotTable = ws_pivot.PivotTables.AddNew("Pivot_Name", ws_pivot.Cell(9, 1), pivot_range)
 pivot_table.ColumnLabels.Add("Column_Name")
 pivot_table.RowLabels.Add("Row_Label_1")   
 pivot_table.RowLabels.Add("Row_Label_2")
 pivot_table.Values.Add("Value_field").SummaryFormula = XLPivotSummary.Count                                      
 pivot_table.ReportFilters.Add("Filter_field")   // Here I need to set a default value... *********** ????? *****************

Thanks!

BadirPJ
  • 3
  • 2

1 Answers1

0

Pivot tables are currently work in progress in ClosedXML. The default filter field is not supported yet.

Francois Botha
  • 4,520
  • 1
  • 34
  • 46
  • It looks like the associated issue is closed in github but I still can't get this to work, at least when trying to set a boolean value as the selected value of a ReportFilter. https://github.com/ClosedXML/ClosedXML/issues/218 – k3davis Mar 09 '21 at 23:56
  • @k3davis You'll have to create a new issue on the Github repo. – Francois Botha Mar 11 '21 at 15:06