Free Support Forum -

Print Area/ Chart

Please see attached excel sheet. Aspose is unable to detect the Print area/ Chart.


Well, it works fine, I can get the print area and charts of the first two sheets as I tested with the following code, I am using v5.1.1:

Workbook book = new Workbook(“e:\test\Aspose+Graphs2.xls”);
Worksheet sheet = book.Worksheets[“DC Trend”];
//Worksheet sheet = book.Worksheets[“C Trend”];
MessageBox.Show(sheet.PageSetup.PrintArea.ToString()); //OK
ChartCollection charts = sheet.Charts;
MessageBox.Show(charts[0].Name); //OK

By the way, do you accessing/manipulating the print area/charts in the sheets.
Could you elaborate the issue and provide us the sample code you are using? We will check it soon.

Thank you.

The charts are accessible, yes, but when we try to convert them to an image file, it fails.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

var options = new ImageOrPrintOptions { HorizontalResolution = 300, VerticalResolution = 300 };

var chartImage = sheet.Charts[0].ToImage(options);


Yes, using your code produces “object reference not set to an instance…” error, we will figure it out soon.
I have logged your issue into our issue tracking system with an id: CELLSNET-18841.

Thank you.


Please try the attached version, we have fixed your issue now.


See attached excel file-

Here is the error we are receiving when trying to process the chart in the InStore file.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

2010-08-03 14:03:07,027 ERROR - Could not process chart for "InStore Cycle Based Revenue" (37) from worksheet "Widget-InStore".

System.ArgumentException: Requested value 'Rectangle' was not found.

at System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument)

at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)

at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)

at x22616b9de762446a.x5d1e907bb5cdea0c.x18e0db5ed9bffa73(AutoShapeType x016ec5cb4cff42a1)

at x22616b9de762446a.x5d1e907bb5cdea0c.xf24c615febf68a06(Shape x337e217cb3ba0627, xa9993ed2e0c64574 x6b8e154b42d5c1e3)

at x22616b9de762446a.x5d1e907bb5cdea0c.x7693e3f5a3f36038(Chart x5304544ad4e02937, xadd4c32f6c1949e6 x95a141982d7ce186)

at x22616b9de762446a.xe8b1095571de92b1.x2889a4c3c8e50fd9(Chart xe640ebcce83ddadc)

at x22616b9de762446a.xe8b1095571de92b1.x83e84e1d3bc59160(Chart xe640ebcce83ddadc)

at Aspose.Cells.Charts.Chart.ToImage(ImageOrPrintOptions options)

I am calling the same code as I previously sent.

var options = new ImageOrPrintOptions { HorizontalResolution = 300, VerticalResolution = 300 };
var chartImage = sheet.Charts[0].ToImage(options);


we have tested the code by using the new DLL (which was attached in the previous post).

Test Envoirment: VS2005, VS2008

nampespaces used:

using Aspose.Cells;
using Aspose.Cells.Charts;
using Aspose.Cells.Rendering;


Workbook book = new Workbook("c:\\Aspose2Charts.xlsx");
Worksheet sheet = book.Worksheets[1];
ChartCollection charts = sheet.Charts;

ImageOrPrintOptions options = new ImageOrPrintOptions { HorizontalResolution = 300, VerticalResolution = 300 };
Bitmap chartImage = sheet.Charts[0].ToImage(options);

It all worked fine. The test image generated is attached.

Please again have a look over it. Update us if the issue persist.


Sorry we weren't clear.

The excel file had 2 widget tabs (Widget F and Widget I). Aspose is only generating the chart for Widget F. We need to generate both charts in the separate tabs.

If you are able to generate Widget F, then on the same lines you can generate Widget I…If you are facing any specific problem to tackle both widgets simultaneously then let us know…

And also share your code which you are using to create charts, then i would be able to figure out your problem statement precisely…

You can also visit the following document for better understanding on charts.

let me know if it helps.


The issues you have found earlier (filed as 18841) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.