Free Support Forum - aspose.com

Issue with Chart Rendering using SheetRender.ToImage

I have noticed a few issues with the images generated using SheetRender.ToImage. Most noticably, the ‘Work’ plot in the attached sample files has several jagged edges in the rendered image that do not appear in the original Excel file. Also, I have noticed that some of the reports are missing the y-Axis labels and other text when a Formula is used to set the value. However, this appears to be resolved by calling Workbook.CalculateFormula() before rendering.

Hi,

Thanks for providing us the sample files.

I have found the issue using your template files with SheetRender API. We will figure your issue out soon.

I have logged your issue into our issue tracking system with an id: CELLSNET-18948.

Thank you.

Thanks for the prompt reply. I forgot to mention before that the gridlines for the maximum values on the x and y axes are also not appearing on the charts. This is not as critical as the work plot issue, but if there is a way to fix this as well it would be much appreciated.

Thanks.

Just wanted to see if any progress has been made on this issue. I have tested these files using both SheetRender and Workbook.Save (to PDF). It seems I can correct some of the issues with the plot series by resetting smoothing (see diameter plot on attached files) on the appropriate NSeries for the affected chart. However, smoothing was not enabled in my input file so I’m not sure why it is getting changed when I instantiate the workbook in Aspose.Cells. Also, the interval for the divisions on the Max Current axis seems to change from 200 (Excel input) to 100 (PDF output). In addition, the gridlines for the maximum values on each chart do not appear in the PDF output. Please advise if there is a fix or workaround for these issues as I would like to purchase Aspose.Cells ASAP, but I cannot move forward until these issues are resolved. My code is below for your reference.
Thanks.

byte[] excelFile = GenerateExcelReport();
Stream s = new MemoryStream(excelFile);
Workbook book = new Workbook(s);
//Ensure that the result of all formulas are calculated
book.CalculateFormula();
//Hide raw data sheets
for (int i = 1; i < book.Worksheets.Count; i++)
{
book.Worksheets[i].VisibilityType = VisibilityType.Hidden;
}
//Correct line smoothing
book.Worksheets[0].Charts[“Chart 7”].NSeries[0].Smooth = false;
Save the workbook as a PDF File
book.SaveOptions.SaveFormat = SaveFormat.Pdf;
book.Save(System.Web.HttpContext.Current.Response,“Report.pdf”,ContentDisposition.Attachment, book.SaveOptions);

Hi,

Thanks for providing us further templates.

I am afraid, we are still working on your issues. There is some complexity involved regarding rendering your charts similar to MS Excel into PDF format. Anyways, we will check if we can provide an eta for your issues. We will get back to you soon.

Thanks for being patient!

Hi,

We have solved the grid lines issue(s). The smoothing issue cannot be solved. You must correct it by changing the smooth property of the series. For changing the smooth to false, you may write codes as you have done or format the line style of the series.

Thank you.