Export Chart from Aspose.Excel- License for WebService

Hello

I am evaluating Aspose.Excel and I am quite impressed! I could not find answers for the following questions:

Q1:
Is there any way to export created charts from a Worksheet?
Q2:
I want to run Aspose.Excel.dll on a web server where Aspose.Excel.dll would be called from another DLL assembly (which in turn is called by the Web Service). Thus, Aspose.Excel.dll would never be called from the Web Service directly. Do I need a Windows license? If not, what would I have to supply for the ‘Page’ parameter in the Excel class constructor?
Q3:
Can the license file be in any folder on the server as long as I supply the correct license file path?

Thanks very much
Andreas

Hi Andreas,

Currently Aspose.Excel doesn’t support the feature to export chart from a worksheet. We are thinking of supplying these feature but I think it will not be available in a short time. Could you tell me your expected date for this feature?

About other two questions about license, I posted them at https://forum.aspose.com/t/159809. Ben will answer these questions.

Dear Andreas,

Please check https://forum.aspose.com/t/159809#5314.

BTW, for licensing and purchasing, please post there.

Hi Laurence,

Thank you for your quick reply. Exporting Charts from a worksheet would be required immediately (I know - everything is ‘immediately’…). I would not need full blown export funcionality, a handle to the underlying graphics object or whatever would be sufficient (it is a WMF or EMF, isn’t it?).

Many thanks anyway
Andreas

Hi Andreas,

Unfortunately MS Excel doesn’t manipulate chart as graphics objects. It save charts in its proprietary formats. So there isn’t an easy way to expose such feature.

@AndreasHaeni,

We recommend you to upgrade from older Aspose.Excel to newer Aspose.Cells that now supports to convert Excel Charts to images and PDF format without requiring any additional tools or applications. In order to provide rendering support, the Chart class has exposed ToImage & ToPdf methods with a verity of overloads to best suit the application requirements.

See the following sample code for your reference:
e.g.
Sample code:

// Instantiating a Workbook object
Workbook workbook = new Workbook();
// Adding a new worksheet to the Workbook
int sheetIndex = workbook.Worksheets.Add();
// Obtaining the reference of the newly added worksheet by passing its index to WorksheetCollection
Worksheet worksheet = workbook.Worksheets[sheetIndex];

// Adding sample values to cells
worksheet.Cells["A1"].PutValue(50);
worksheet.Cells["A2"].PutValue(100);
worksheet.Cells["A3"].PutValue(150);
worksheet.Cells["B1"].PutValue(4);
worksheet.Cells["B2"].PutValue(20);
worksheet.Cells["B3"].PutValue(50);

// Adding a chart to the worksheet
int chartIndex = worksheet.Charts.Add(Aspose.Cells.Charts.ChartType.Column, 5, 0, 15, 5);
// Accessing the instance of the newly added chart
Aspose.Cells.Charts.Chart chart = worksheet.Charts[chartIndex];
// Adding Series Collection (chart data source) to the chart ranging from "A1" cell to "B3"
chart.NSeries.Add("A1:B3", true);

// Create an instance of ImageOrPrintOptions and set a few properties
ImageOrPrintOptions options = new ImageOrPrintOptions()
{
    VerticalResolution = 300,
    HorizontalResolution = 300,
    SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias
};
// Convert chart to image with additional settings
chart.ToImage("chartPNG_out.png", options);

See the document on how to convert a chart to image for your reference.

The latest versions of the product are available here:
Aspose.Cells for .NET (Latest Version)

You can also download the latest demos here.