-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pivot table could not work #65
Comments
Same trouble with pivot at try call SaveAs().
|
@Fox2726 @MiNGRotten Can you send your template and sample code so that I can repeat this issue? Tests with Pivot available in ClosedXML.Report work as it should. |
Here is the sample code for test. We use the same template file "tPivot1.xlsx" in test project. |
|
@Fox2726 Your template does not match the data you pass. ClosedXML cannot fill a pivot table, so it throws an exception. In order for your code to work with this template, the order class must have the fields {Company, PaymentMethod, OrderNo, ShipDate, ItemsTotal, TaxRate, AmountPaid} filled in |
@MiNGRotten Artem, could you send me a code that I can execute? It is not clear from the presented code which fields the row object has and how they are filled. |
@b0bi79, i can send dto which is used with pivot.
|
@b0bi79 Thanks. i add the code like you say. And i got a new error message. new code:
} |
@Fox2726 In your template, the table is called Orders with a capital letter. |
@MiNGRotten In the data for which there is a grouping (tags |
@b0bi79 many thanks. it works. |
Yes it is possible.
In the template you can refer to the fields so: |
@b0bi79, understood thanks. |
@b0bi79 thanks. And I had a suggestion about column name from datatable to write in template directly. |
@MiNGRotten This issue is not in ClosedXML.Report, but in ClosedXML. ClosedXML.Report currently uses ClosedXML version 0.92, but ClosedXML has already been released version 0.94. Now I am working on the transition to the new version of ClosedXML |
Everything is fine in flat table. After we try to add <> to the same template file and set up column define like below picture. But it not works.
When we run in the process.
System had a error in Saveas. And it show "source" parameter could not be null.
error message as below
於 System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)
於 ClosedXML.Excel.XLWorkbook.GeneratePivotTableCacheDefinitionPartContent(PivotTableCacheDefinitionPart pivotTableCacheDefinitionPart, IXLPivotTable pt, SaveContext context)
於 ClosedXML.Excel.XLWorkbook.GeneratePivotTables(WorkbookPart workbookPart, WorksheetPart worksheetPart, XLWorksheet xlWorksheet, SaveContext context)
於 ClosedXML.Excel.XLWorkbook.CreateParts(SpreadsheetDocument document, SaveOptions options)
於 ClosedXML.Excel.XLWorkbook.CreatePackage(String filePath, SpreadsheetDocumentType spreadsheetDocumentType, SaveOptions options)
於 ClosedXML.Excel.XLWorkbook.SaveAs(String file, SaveOptions options)
於 ClosedXML.Excel.XLWorkbook.SaveAs(String file, Boolean validate, Boolean evaluateFormulae)
於 ClosedXML.Excel.XLWorkbook.SaveAs(String file)
於 ClosedXML.Report.XLTemplate.SaveAs(String file)
Thanks in advance.
The text was updated successfully, but these errors were encountered: