Text Wrap Troubles

I am evaluating Aspose .Cells in order to import an Excel spreadsheet into an Aspose WebGrid.

I am having trouble with the WebGrid TableItemStyle Wrap member.

The below code is not wrapping text (also, other members that I have tried which inherit from Style - such as Height and Width - do not appear to work for me):

String cellID;
for (int col = 1; col <= gridWeb1.WebWorksheets[0].Cells.MaxColumn; col++)
{
// Set formatting for GridWeb Header Row
cellID = GetExcelColumnName(col) + "1";
Aspose.Cells.GridWeb.Data.WebCell thisCell = gridWeb1.WebWorksheets[0].Cells[cellID];
Aspose.Cells.GridWeb.TableItemStyle headerStyle = thisCell.GetStyle();
headerStyle.Font.Bold = true;
headerStyle.Font.Size = FontUnit.Point(10);
headerStyle.HorizontalAlign = HorizontalAlign.Center;
headerStyle.VerticalAlign = VerticalAlign.Bottom;
headerStyle.ForeColor = Color.Black;
headerStyle.BackColor = Color.LightYellow;
headerStyle.Wrap = true;
thisCell.SetStyle(headerStyle);
}

The font bold, size, vertical/horizontal alignment/colors are all working fine, so I know that the headerStyle is working.

Your insights into to what I'm doing wrong would be greatly appreciated.

Paul Perkins

Hi,


I can find the issue as you mentioned by using a simplest code as given below:

Sample code:


GridWeb1.WebWorksheets.Clear();
GridWeb1.WebWorksheets.Add();

//set sheets selectedIndex to 0
GridWeb1.WebWorksheets.ActiveSheetIndex = 0;

Aspose.Cells.GridWeb.Data.WebCell thisCell = GridWeb1.WebWorksheets[0].Cells[“A1”];
thisCell.PutValue(“This is a long text for testing”);

Aspose.Cells.GridWeb.TableItemStyle headerStyle = thisCell.GetStyle();
headerStyle.Font.Bold = true;
headerStyle.Font.Size = FontUnit.Point(10);
headerStyle.HorizontalAlign = HorizontalAlign.Center;
headerStyle.VerticalAlign = VerticalAlign.Bottom;
headerStyle.ForeColor = Color.Black;
headerStyle.BackColor = Color.LightYellow;
headerStyle.Wrap = true;
thisCell.SetStyle(headerStyle);

The text wrap attribute does not work.

I have logged a ticket with an id: CELLSNET-40335. We will soon look into it.

Thank you.

Hi,

We have fixed this issue. Please download: Aspose.Cells for GridWeb v2.7.2.2003


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


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