How to set part of text in cell to bold

Hi,

was wondering how do i set part of a text in a cell to be bold ? i am reading the values from a database.

for eg i read 2 values from the db, and display in excel, something like this in a cell:

title
text

please help

Please check Adding HTML Rich Text inside the Cell.

Hi Laurence,

it worked. but somehow the font is smaller. tried using cell.style.font.size = 12 but still does not work. i tried cell.characters.font.size = 12 but there's this error Unable to cast object of type 'System.String' to type 'Aspose.Excel.ai'.

Also, when i try to use autofitrow on cells that contains carriage return '\n'. it doesn't work too. it will only show the first line. the rest is hidden.

can u help ?

That may be a problem in old version.

Following is my sample code with latest version of Aspose.Cells.

Workbook workbook = new Workbook();
Cell cell = workbook.Worksheets[0].Cells["A1"];
cell.PutValue("Title\ntext");
cell.Style.IsTextWrapped = true;
cell.Characters(0, 5).Font.IsBold = true;
cell.Characters(0, 5).Font.Size = 12;

workbook.Worksheets[0].AutoFitRow(0);

workbook.Save("d:\\test\\abc.xls");

Attached is new Aspose.Cells.dll and output file.

Hi Laurence,

I realised the dll that I used is Aspose.Excel.dll and i have the license for this. Version is 2.9.7.3. i can't use the Aspose.Cells dll as i do not have the license for this. I need to generate thousands of reports and i can't afford to go in and delete the last worksheet that contains the evaluation warning message.

Is there anyway u can get me a hotfix for this version instead?

Could you tell me the expiry date of your license file? I can post an old version of Aspose.Excel for you. However, I think it's better to renew your subscription.

hi

expiry date is 20060301. Do we need to pay to renew?

thanks

Yes, you need to pay to renew.

You can download and try Aspose.Cells v3.7. It's released before 060301 and you can use it without renewal.

help, tried but i am still seeing the Evaluation Copyright warning worksheet

How do you set the license? Please try:

Aspose.Cells.License lic = new Aspose.Cells.License();

lic.SetLicense("d:\\lic\\Aspose.Excel.lic");

Excel excel = new Excel();
Cell cell = excel.Worksheets[0].Cells["A1"];
cell.PutValue("Title\ntext");
cell.Style.IsTextWrapped = true;
cell.Characters(0, 5).Font.IsBold = true;
cell.Characters(0, 5).Font.Size = 12;

workbook.Worksheets[0].AutoFitRow(0);

workbook.Save("d:\\test\\abc.xls");

Smile [:)] thanks so much, it works now.