We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Cell formatted text is richtext?

Hi,
we are currently examining .aspose.cells for reading Excel files.

First Question:

cell Text: abcdefgh
cell Text :abcdefgh

In Excel i would get a Null if i look for bold in aspose a false.
Is there any way to get a Information that a richttext is in cell without looking at every character?

Thanks a lot.

@tbjeanie,

Thanks for the details.

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

string filePath = @"e:\test2\NameSample.xlsx";
            Workbook workbook = new Workbook(filePath);
            Worksheet worksheet = workbook.Worksheets[0];
            foreach (Aspose.Cells.Cell cell in worksheet.Cells)
            {

                FontSetting[] fntSettings = cell.GetCharacters();

                if (fntSettings != null)
                {

                    foreach (FontSetting fnt in fntSettings)
                    {

                        if (fnt.Font.IsBold == true)
                        {

                            string boldText = cell.StringValue.Substring(fnt.StartIndex, fnt.Length);
                            Debug.WriteLine("[Cell Name]: " + cell.Name + " [Bold Text]: " + boldText);

                        }//if

                    }//foreach

                }//if



                //In case if it is null, then check style object
                Style st = cell.GetStyle();
                if (fntSettings == null && st.Font.IsBold == true)
                {
                    string boldText = cell.StringValue;
                    Debug.WriteLine("[Cell Name1]: " + cell.Name + " [Bold Text]: " + boldText);

                }

            }//foreach 

Hope, this helps a bit.

Hi,
tx for the fast answer. It helps a lot.
But it is not really comparable to Excel because in Aspose it will return allways a Fontsettingobject if any character is somehow formatted (e.g. italic). In Excel one would check for bold - gets a null if one or more chars are bold but not all, gets a true if all are bold and false if None is bold, Independent from other formattings.
And this even for a range of cells. But it seems, that moving through the cells is fast enough.

I must say, that Aspose gives a lot of understanding Problems, cause it’s Interface is quite different to Excel Interop.
But it seems quite good if you find out how to work with it. But that is very time consuming.
Thanks again and i will surely haver more qestions.
Regards

@tbjeanie,

Thank you for the feedback. We always try to make our product user friendly and provide all features on a par with Excel. You may please contact us if any issue is observed while using Aspose.Cells. We will try to provide assistance at the earliest.