Getting entries of formula and chart

Hi,

I want to know if exist methods that permits to :

- to search in a sheet the existing charts

- to recuperate the entries of a formula, for example we have (=SUM(A1/A4) and this method should return A1 and A4

- to recuperate the entries of a chart

I hope you can help me, and if it is possible to mention what are the names of this methods

Thanks.

Hi,

Thanks for considering Aspose.

If you are using Aspose.Cells .Net, please check:

- to search in a sheet the existing charts

Well, you may use Worksheet.Charts Property to get the collection of the designer chart. To get a specific chart, you may get by its index position.

E.g., Chart chart = workbook.Worksheets[0].Charts[0];// retrieves the first chart in the first worksheet.

- to recuperate the entries of a formula, for example we have (=SUM(A1/A4) and this method should return A1 and A4

Well, you may use Cell.Formula Property to get the formula string of the cell. And you may use Cell.StringValue Property to get the resultant value. To get the result of a formula at runtime, you will use this property after calling Workbook.CalculateFormula() method.

- to recuperate the entries of a chart

Well, after getting the designer chart object , you will use all those APIs (Classes, Properties, methods etc.), which are used to create a chart from the scratch. To know more about the Chart Related APIs, you can check the source code of the chart demos in our online featured demos.

Thank you.

Thanks,

What is the difference between :

Cell cc = sheet.Cells.FindFormulaContains("=SUM(A1:A3)", null);

AND

cc = sheet.Cells.FindFormula("=SUM(A1:A3)", null);

Because gives the same result

Is it possible to search formulas without to know their value ?

Hi,

Thanks for considering Aspose.

Ok I try to explain a bit:

1. Well, Cells.FindFormulaContains("formula string",...) method retrieves the formulated cell searching the formula which contains formula string or part of the formula string. For example, you may give here (part of formula string) "=SUM" or "A1:A3", it will search that part in all the formulated cells and returns the first cell which contains that formula string or part of the formula string.

2. Cells.FindFormula() also searches the formula string and retrieves the first cell which contains that formula. But to use this method, you have to make sure that you will give the complete formula string "=SUM(A1:A3)" and not the part of the formula string, without eliminating any part or character of it. If it does not match the complete formula string like "=SUM(A1:A3", a NullReferenceException will be thrown and formula is not searched. Got it!

Is it possible to search formulas without to know their value ?

Yes, you may try to use Cell.IsFormula Boolean Property. The property will return true if the cell contains the formula, otherwise false.

Thank you.

Thanks, i see better the difference now.