Clearing Pivot Table data without destroying the Pivot Table
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 18/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- csharp
- Lĩnh vực
- documentation
Hướng nghiên cứu
Không có tệp, kiểm thử hay điểm vào nào của repository được nêu tên. Hãy bắt đầu bằng việc xem xét phương thức SetPivotRefresh cùng các API PivotTableCacheDefinitionPart và PivotCacheDefinition được tham chiếu, sau đó xác định liệu tài liệu có nên đề cập đến việc xóa các bản ghi bộ nhớ đệm trong khi vẫn giữ nguyên bảng pivot hay không, cũng như các workbook được bảo vệ hoặc chỉ đọc ảnh hưởng như thế nào đến hành vi làm mới.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
We have a situation where we have a spreadsheet with a sheet data and the second sheet containing a pivot table. Some of our customers open their spreadsheets in read only or protected mode in Excel, which causes a notification that the pivot table cannot be updated upon opening it. Only the first sheet with the data is updated when we create the spreadsheet. The sheet with the pivot table is updated upon opening the spreadsheet (except in this case).
I've been looking everywhere and trying anything to remove the cache or the fields and get it to work. I want the pivot table to stay intact but not to present un-updated data in the pivot table sheet. We have a way to update the pivot table upon opening, but the problem has to do with the workbook being opened readonly or in protected mode which shows un-updated and wrong data in the pivot table.
This is what we use to make the sheet updatable and I've been trying to remove some things and to keep the workbook from displaying errors that a part is missing or something else, but with no succes:
void SetPivotRefresh(Sheet sheet, bool sourceLocked)
{
try
{
List<PivotTableCacheDefinitionPart> pivotTableCacheDefinitionParts =
_openXmlSpreadsheetDocument.WorkbookPart.PivotTableCacheDefinitionParts.Where(x =>
x.PivotCacheDefinition.CacheSource.WorksheetSource.Name == sheet.CompleteName || x.PivotCacheDefinition.CacheSource.WorksheetSource.Sheet == sheet.CompleteName).ToList();
foreach (PivotTableCacheDefinitionPart pivotTableCacheDefinition in pivotTableCacheDefinitionParts)
{
pivotTableCacheDefinition.PivotCacheDefinition.EnableRefresh = true;
pivotTableCacheDefinition.PivotCacheDefinition.RefreshOnLoad = true;
pivotTableCacheDefinition.PivotCacheDefinition.RecordCount = Convert.ToUInt32(sheet.RowCount);
if (!sourceLocked)
{
WorksheetSource worksheetSource = pivotTableCacheDefinition.PivotCacheDefinition.PivotTableCacheDefinitionPart.PivotCacheDefinition.CacheSource.WorksheetSource;
// otherwise a share violation will be given and files built with OpenXML or Excel use these properties differently
worksheetSource.Sheet = sheet.CompleteName;
worksheetSource.Name = null;
string startingCellReference = sheet.ColumnDefinitions.FirstOrDefault()?.CellReference;
worksheetSource.Reference = startingCellReference + ":" + SpreadsheetHelper.ConvertColumnNumberToName(sheet.ColumnCount) + (sheet.RowCount + 1);
}
// Remove cache so that new information is updated
pivotTableCacheDefinition.PivotTableCacheRecordsPart.PivotCacheRecords.RemoveAllChildren();
pivotTableCacheDefinition.PivotTableCacheRecordsPart.PivotCacheRecords.Count = 0;
pivotTableCacheDefinition.PivotCacheDefinition.Save();
}
}
catch (Exception e)
{
Log.LogHandledException(e);
}
}
"sheet" is our own object which contains all the data that should go into an Excel sheet.
- Ngôn ngữ chính
- PowerShell
- Star
- 109
- Fork
- 72
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của OfficeDev/open-xml-docs
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
OfficeDev/open-xml-docs#355 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
OfficeDev/open-xml-docs#343 · 2 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
OfficeDev/open-xml-docs#333 ·
-
Update documentation for latest versionsCó thể làm lại được @twsouthwick đã nhận 1082 ngày trước và không có pull request nào đang mở. Đang mở
OfficeDev/open-xml-docs#159 · 6 bình luận · 1 người được giao ·
-
cant find Deleted InsertedĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
OfficeDev/open-xml-docs#153 · 1 bình luận ·
Tất cả issue của OfficeDev/open-xml-docs
Issue tương tự
-
bug documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
labmonkeys-space/nl6#974 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
r-afael/better-yt-recommendations#16 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
README translations: ja, ko, deĐang mởdocumentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:docs documentation good first issue priority:medium
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
rtk-ai/rtk#4958 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
microsoft/microsoft-ui-xaml#12515 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày