Hello,
I am able to generate a treemap using LINQ.
However, if I call doc.UpdatePageLayout()
to update the table of content, the chart is no longer updated.
We see the original template instead.
LicenseManager.Initialize();
var dataDir = "C:\\Users\\User1\\";
List<PointData> data =
[
new PointData { Client = "Company1", Manager = "Manager1", Country = "Australia", Price = 500 },
new PointData { Client = "Company2", Manager = "Manager2", Country = "Australia", Price = 1500 },
new PointData { Client = "Company3", Manager = "Manager3", Country = "New Zealand", Price = 200 },
];
Document doc = new Document(dataDir + "TreemapTemplate.docx");
ReportingEngine engine = new ReportingEngine();
engine.BuildReport(doc, [data,], ["contracts"]);
// The bug is here.
// If we update the page layout, the treemap will not be updated.
doc.UpdatePageLayout();
doc.Save(dataDir + "TreemapTemplate_Out.docx");
@f.rochat
It appears that the LINQ Reporting Engine currently does not support treemap and sunburst charts. This limitation means that when you call doc.UpdatePageLayout()
, the treemap may revert to the original template instead of updating with the new data.
A feature request has been logged for this issue, but as of now, it is still pending analysis. The LINQ Reporting Engine supports various other chart types, including column, line, pie, bar, area, scatter, surface, and radar charts, but treemaps are not among them at this time.
For more information on the supported chart types and how to work with them, you can refer to the following resources:
If you need to work with treemaps specifically, you may want to keep an eye on updates regarding this feature request or consider alternative chart types that are supported.
Sources:
[1]: Treemap and sunburst charts in LINQ Reporting Engine
[2]: Treemap and sunburst charts in LINQ Reporting Engine
Hello,
The treemap is supported.
It is in the LINQ documentation:
[Appendix C. Typical Templates in C#|Aspose.Words for .NET](https://Treemap Chart Template)
What does not work is the treemap + automatic update of table of content.
Thank you,
Frederic
@f.rochat To update TOC you should call Document.UpdateFields
, not Document.UpdatePageLayout
.
Also, could you please attach your input, output and expected output documents here for testing? We will check the issue and provide you more information.
Hello,
Here is the source code :
using DomosWord.Aspose;
using Aspose.Words;
using Aspose.Words.Reporting;
internal class Program
{
private static void Main(string[] args)
{
LicenseManager.Initialize();
var dataDir = "C:\\Users\\User1\\";
List<PointData> data =
[
new PointData { Client = "Company1", Manager = "Manager1", Country = "Australia", Price = 500 },
new PointData { Client = "Company2", Manager = "Manager2", Country = "Australia", Price = 1500 },
new PointData { Client = "Company3", Manager = "Manager3", Country = "New Zealand", Price = 200 },
];
Document doc = new Document(dataDir + "TreemapTemplate.docx");
ReportingEngine engine = new ReportingEngine();
engine.BuildReport(doc, [data,], ["contracts"]);
// The bug is here.
// If we update the page layout, the treemap will not be updated.
doc.UpdatePageLayout();
doc.Save(dataDir + "TreemapTemplate_Out.docx");
}
}
public class PointData
{
public string Client { get; set; }
public string Manager{ get; set; }
public string Country { get; set; }
public double Price{ get; set; }
}
with the template :
TreemapTemplate.docx (33.2 KB)
If I run it as is, I will get this output file:
TreemapTemplate_Out_KO.docx (18.0 KB)
Instead of the treemap, I have an image which looks like the template:
if I comment out the line:
// doc.UpdatePageLayout();
The output document is correct:
TreemapTemplate_Out_OK.docx (21.1 KB)
Thank you,
Frederic
@f.rochat
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): WORDSNET-27614
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.