You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an Excel file that i use as template, which already contains a Pivot Table. This pivot table is grouped by years, quarter and month, and is the base for a chart.
After the ExcelPackage is saved, though, the filters/grouping disappear.
The only operation i did on the pivot was to change the CacheDefinition.SourceRange, but i also tried executing it without making any change to the pivot, and it still loses the filters.
Also, the file is an .xlsm that contains macro, but the macros don't interact with the pivot table or the table which uses as source.
The text was updated successfully, but these errors were encountered:
var OutputFile = $"C:\\Users\\user\\Desktop\\Out_{DateTime.Now.Millisecond}.xlsm";
using var template = File.OpenRead("Settimanale.xlsm");
MemoryStream ret = new MemoryStream();
using (var document = new ExcelPackage(ret, template))
{
string sheetNameConfrontoRichieste22_23_24 = "confronto richieste 22-23-24";
var sheetConfrontoRichieste22_23_24 = document.Workbook.Worksheets[sheetNameConfrontoRichieste22_23_24];
int sheetConfrontoRichiesteSettingsStartRow = 3;
var sheetConfrontoRichieste = document.Workbook.Worksheets["input confronto richieste"];
document.Save();
ret.Position = 0;
}
using (FileStream file = new FileStream(OutputFile, FileMode.Create, FileAccess.Write))
{
ret.WriteTo(file);
}
EPPlus will refresh the pivot table on save, so if there is no data in the source the items will disappear..
Looking at the sample attached it's not clear to me what the issue is. It contains several worksheets and pivot tables.
Can you provide an isolated sample that shows the issue?
EPPlus usage
Noncommercial use
Environment
Windows
Epplus version
7.5.0
Spreadsheet application
Excel
Description
I have an Excel file that i use as template, which already contains a Pivot Table. This pivot table is grouped by years, quarter and month, and is the base for a chart.
After the ExcelPackage is saved, though, the filters/grouping disappear.
The only operation i did on the pivot was to change the CacheDefinition.SourceRange, but i also tried executing it without making any change to the pivot, and it still loses the filters.
Also, the file is an .xlsm that contains macro, but the macros don't interact with the pivot table or the table which uses as source.
The text was updated successfully, but these errors were encountered: