Hi Team,
When i convert pivot chart to image then every time blank image saves. Problem only occurs in pivot charts. Below is my code:
void SaveChartToImage(Workbook wb, Worksheet ws,string strChartName)
{
helpingFunctions objHelpFunc = new helpingFunctions();
foreach (Aspose.Cells.Pivot.PivotTable pt in wb.Worksheets["PivotTables"].PivotTables)
{
pt.RefreshData();
pt.CalculateData();
// pt.RefreshDataOnOpeningFile = true;
}
Aspose.Cells.Charts.Chart chart = ws.Charts[strChartName];
chart.Calculate();
wb.CalculateFormula();
ImageOrPrintOptions options = new ImageOrPrintOptions()
{
VerticalResolution = 300,
HorizontalResolution = 300,
SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias
};
chart.ToImage(objHelpFunc.GetOutputPath(strChartName + ".jpg"), options);
}
Chart 16.jpg (86.6 KB)